我从模板初始化 Yesod 项目。我在 Foundation.hs 尝试更改 css 变量时出错
$ stack new s1 yesod-simple
$ cd s1
$ mv static/css/bootstrap.css static/css/style.css
Run Code Online (Sandbox Code Playgroud)
改变基础.hs
pc <- widgetToPageContent $ do
addStylesheet $ StaticR css_bootstrap_css
$(widgetFile "default-layout")
Run Code Online (Sandbox Code Playgroud)
到
pc <- widgetToPageContent $ do
addStylesheet $ StaticR css_style_css
$(widgetFile "default-layout")
$ stack build
...
[4 of 8] Compiling Foundation ( Foundation.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Foundation.o )
Foundation.hs:64:37: Not in scope: ‘css_style_css’
Run Code Online (Sandbox Code Playgroud)
但据我所知,在编译时 css_style_css 应该会自动出现。我做错了什么?如果我们需要在默认布局中添加几个 css 文件,我该怎么办?