Including a static css file

I am experimenting with yesod and am new to it. I changed the default-layout.hamlet file of a project created by yesod init. The modification consists of the following line <link rel="stylesheet" type="text/css" href="@{StaticR css/base.css}"> I get an error message " (line 4, column 48): unexpected 'h' expecting end of input, "\n", "\r\n" or ">" The file static/css/base.css does exist.

On Sun, Jul 17, 2011 at 10:46 PM, Anakreon Mentis
I am experimenting with yesod and am new to it. I changed the default-layout.hamlet file of a project created by yesod init. The modification consists of the following line <link rel="stylesheet" type="text/css" href="@{StaticR css/base.css}">
I get an error message " (line 4, column 48): unexpected 'h' expecting end of input, "\n", "\r\n" or ">"
The file static/css/base.css does exist.
Try replacing "css/base.css" with "css_base_css". The file StaticFiles.hs calls creates identifiers for every file in the static folder, but it has to follow the rules of Haskell naming. Basically, more characters get replaced with an underscore. Michael

On Mon, Jul 18, 2011 at 12:41 PM, Michael Snoyman
On Sun, Jul 17, 2011 at 10:46 PM, Anakreon Mentis
wrote: I am experimenting with yesod and am new to it. I changed the default-layout.hamlet file of a project created by yesod init. The modification consists of the following line <link rel="stylesheet" type="text/css" href="@{StaticR css/base.css}">
I get an error message " (line 4, column 48): unexpected 'h' expecting end of input, "\n", "\r\n" or ">"
The file static/css/base.css does exist.
Try replacing "css/base.css" with "css_base_css". The file StaticFiles.hs calls creates identifiers for every file in the static folder, but it has to follow the rules of Haskell naming. Basically, more characters get replaced with an underscore.
does it uniquely identify files? static/css.base.css static/css/base.css
Michael
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
-- -barkmadley sent from an internet enabled device http://barkmadley.com

On Mon, Jul 18, 2011 at 5:48 AM, Mark Bradley
On Mon, Jul 18, 2011 at 12:41 PM, Michael Snoyman
wrote: On Sun, Jul 17, 2011 at 10:46 PM, Anakreon Mentis
wrote: I am experimenting with yesod and am new to it. I changed the default-layout.hamlet file of a project created by yesod init. The modification consists of the following line <link rel="stylesheet" type="text/css" href="@{StaticR css/base.css}">
I get an error message " (line 4, column 48): unexpected 'h' expecting end of input, "\n", "\r\n" or ">"
The file static/css/base.css does exist.
Try replacing "css/base.css" with "css_base_css". The file StaticFiles.hs calls creates identifiers for every file in the static folder, but it has to follow the rules of Haskell naming. Basically, more characters get replaced with an underscore.
does it uniquely identify files?
static/css.base.css static/css/base.css
I believe that will cause a compiler error. Michael

Now I get the error: CMS.hs:86:26: Not in scope: `css_base_css' In the first argument of `hamletToRepHtml', namely `$(hamletFile "default-layout")' In the expression: hamletToRepHtml ($(hamletFile "default-layout")) In the expression: do { mmsg <- getMessage; pc <- widgetToPageContent $ do { widget; addCassius ($(cassiusFile "default-layout")) }; hamletToRepHtml ($(hamletFile "default-layout")) } The documentation for hamlet at http://www.yesodweb.com/hamlet is unavailable.

The docs for Hamlet are on Hackage:
http://hackage.haskell.org/package/hamlet and in the Yesod book:
http://www.yesodweb.com/book/templates .
Just to confirm: are you using the scaffolded site? You most likely
need to tell GHC to rebuild StaticFiles by touching that file.
(Alternatively, just do "cabal clean && cabal configure && cabal
build".) I just added some code to the repo that will automate this
process, but it's not on Hackage yet.
Michael
On Mon, Jul 18, 2011 at 1:32 PM, Anakreon Mentis
Now I get the error: CMS.hs:86:26: Not in scope: `css_base_css' In the first argument of `hamletToRepHtml', namely `$(hamletFile "default-layout")' In the expression: hamletToRepHtml ($(hamletFile "default-layout")) In the expression: do { mmsg <- getMessage; pc <- widgetToPageContent $ do { widget; addCassius ($(cassiusFile "default-layout")) }; hamletToRepHtml ($(hamletFile "default-layout")) }
The documentation for hamlet at http://www.yesodweb.com/hamlet is unavailable.
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
participants (3)
-
Anakreon Mentis
-
Mark Bradley
-
Michael Snoyman