Yesod 0.9.3.2 中静态 CSS 的链接
我正在遵循 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 的工作原理,但我显然错过了一些东西。有什么想法吗?
提前致谢, 尼尔
I'm following along with the yesod tutorial on the yesod wiki, and hitting a wall linking to an external css framework (blueprint).
I created the site using the scaffolding tool, and everything has been working correctly so far using 'yesod devel'.
I've downloaded the blueprint files into static/css/blueprint and added the following to 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}
The error I'm getting is:
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...
I'm on a Mac, running ghc-7.0.3... I thought I understand how StaticR works, but I'm obviously missing something. Any ideas?
Thanks in advance,
Neil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要
触摸Settings/StaticFiles.hs
吗?一般来说,yesod devel 或 yesod build 会自动为您处理,但这是您首先想到的事情。Do you need to
touch Settings/StaticFiles.hs
? In general,yesod devel
oryesod build
will handle that for you automatically, but it's the first thing that comes to mind.