我将遵循yesod Wiki上的yesod教程,并碰壁连接到外部CSS框架(蓝图)的墙。

我使用脚手架工具创建了该站点,到目前为止,使用“yesod devel”可以正常运行。

我已将蓝图文件下载到static / css / blueprint中,并将以下内容添加到default-layout-wrapper.hamlet中:

!!!
<html>
    <head
        <title>#{pageTitle pc}
        <link rel=stylesheet type=text/css media=screen href=@{StaticR css_blueprint_screen_css}>
        <link rel=stylesheet type=text/css media=print href=@{StaticR css_blueprint_print_css}>
        ^{pageHead pc}
    <body
        ^{pageBody pc}

我得到的错误是:
Foundation.hs:98:27:
    Not in scope: `css_blueprint_screen_css'
    In the result of the splice:
      $(hamletFile "hamlet/default-layout-wrapper.hamlet")
    To see what the splice expanded to, use -ddump-splices
    In the first argument of `hamletToRepHtml', namely
      `$(hamletFile "hamlet/default-layout-wrapper.hamlet")'
    In the expression:
      hamletToRepHtml
        ($(hamletFile "hamlet/default-layout-wrapper.hamlet"))

Foundation.hs:98:27:
    Not in scope: `css_blueprint_print_css'
    In the result of the splice:
      $(hamletFile "hamlet/default-layout-wrapper.hamlet")
    To see what the splice expanded to, use -ddump-splices
    In the first argument of `hamletToRepHtml', namely
      `$(hamletFile "hamlet/default-layout-wrapper.hamlet")'
    In the expression:
      hamletToRepHtml
        ($(hamletFile "hamlet/default-layout-wrapper.hamlet"))
Starting development server...

我在Mac上运行ghc-7.0.3 ...我以为我了解StaticR的工作原理,但显然缺少某些东西。有任何想法吗?

提前致谢,
尼尔

最佳答案

您需要touch Settings/StaticFiles.hs吗?通常,yesod develyesod build将自动为您处理该问题,但这是我想到的第一件事。

关于yesod - 在Yesod 0.9.3.2中链接到静态CSS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7780723/

10-12 23:23