我正在关注 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...
我在运行 ghc-7.0.3 的 Mac 上...我以为我了解 StaticR 的工作原理,但我显然遗漏了一些东西。有任何想法吗?
提前致谢, 尼尔