- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我看到 create 函数需要一个标识符列表。
ghci λ> :t create
create :: [Identifier] -> Rules () -> Rules ()
create "/" $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create "/*" $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create "." $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create "./" $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create "/." $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create "" $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create Nothing $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
site.hs:24:12: error:
• Couldn't match type ‘Identifier’ with ‘Char’
arising from the literal ‘""’
• In the first argument of ‘create’, namely ‘""’
In the expression: create ""
In a stmt of a 'do' block:
create ""
$ do { route idRoute;
compile
$ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls }
Failed, modules loaded: none.
Loaded GHCi configuration from /tmp/ghci29841/ghci-script
:i Identifier
或
reading documentation或
reading the source code让我更清楚:
ghci λ> :i Identifier
data Identifier
= Hakyll.Core.Identifier.Identifier {identifierVersion :: Maybe
String,
Hakyll.Core.Identifier.identifierPath :: String}
-- Defined in ‘Hakyll.Core.Identifier’
instance Eq Identifier -- Defined in ‘Hakyll.Core.Identifier’
instance Ord Identifier -- Defined in ‘Hakyll.Core.Identifier’
instance Show Identifier -- Defined in ‘Hakyll.Core.Identifier’
最佳答案
create
函数需要 Identifiers
的列表.对于单个元素,只需用方括号 ([]
) 将其括起来。和Identifier
是 IsString
的成员类所以假设你启用了-XOverloadedStrings
你可以只用一个普通的带引号的字符串文字( "index.html"
)来构建一个。
因此,要创建一个在根目录下提供的文件,您将编写:
create ["index.html"] $ do
route idRoute
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
http://www.example.com/
)时,提醒文件的内容
index.html
返回(除非服务器以其他方式配置,但这是标准。)
关于haskell - Hakyll 网站的根源是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46356263/
我正在关注 Hakyll 教程,就像在此 https://jaspervdj.be/hakyll/tutorials/01-installation.html 中一样. 但似乎有些不对劲,我说不清是什
我看到 create 函数需要一个标识符列表。 ghci λ> :t create create :: [Identifier] -> Rules () -> Rules () 我应该使用哪个标
我希望修改下面的代码,这样,它不会生成指向网站上最新三篇文章的链接,而是完全复制文章的正文,就像在传统博客中一样。我有点难以理解下面发生了什么,以及必要的改变是什么。 match "index.htm
我想根据元数据值过滤我网站上的一些帖子。我想创建一个名为 status 的特定元数据(例如 title 或 date),它可以采用多个值(草稿、已发布、存档): --- title: The titl
我正在尝试做类似 what's described in this tutorial 的事情,即,向我的 Hakyll 博客添加标签,但不是为每个标签生成一个页面,只需一个页面列出所有标签及其帖子。所
我使用 Hakyll 生成一些文档,我注意到它有一种奇怪的方式来关闭它生成的代码中的 HTML 标签。 有一个页面他们说你必须像他们那样生成标记,否则你的页面布局在某些情况下会被破坏,但我现在找不到了
我正在尝试 Hakyll对于学术和数学为主的静态网站。我想使用 pandoc-crossref用于对方程式的交叉引用。 将 pandoc-crossref 包含到编译器链中的最简单方法是什么? 到目前
我很抱歉问这样的问题。但我对 Haskell 真的很陌生。我在互联网上搜索了一整天,但没有找到任何示例。 我有一个用 python 编写的 pandoc 过滤器( tikzcd.py )。我想使用该过
使用 hakyll-init site_foo 生成的骨架网站,我想将 site_foo/index.html 转换为 markdown 并仍然保留其内容。 换句话说,有一个引用 posts-list
我使用 Hakyll对于我的 blog . 我目前正在写我的帖子 emacs org-mode然后将组织模式导出到 markdown .然后 Hakyll 将该 markdown 转换为 HTML。
我关注了 this tutorial使用 hakyll 创建一个基本的静态网页。它包括许多从 posts 中的 Markdown 呈现的页面。目录,例如2015-08-12-spqr.markdown
我有一个类别列表。每个类别本身都有一个子类别列表:[(Category,[SubCategory])]。我想在单个页面中获得以下 HTML 输出: Category 1 Subcategory
在我的 Hakyll 站点中,我有一个链接到页面的样式表: 此 CSS 包含 @font-face链接到字体文件的指令: @font-face { font-family: "Bla"; src
我正在使用 Hakyll 制作个人网站,我想列出我的出版物。 我找到了 this module和 this guide了解如何从底部的 Markdown 文档中打印引用。 这样做的问题是,它假设您有一
我是一名优秀的程序员,十分优秀!