diff options
-rw-r--r-- | src/Hakyll/Web/Feed.hs | 6 | ||||
-rw-r--r-- | tests/Hakyll/Web/Page/Metadata/Tests.hs | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Hakyll/Web/Feed.hs b/src/Hakyll/Web/Feed.hs index 77c97d3..f64bb55 100644 --- a/src/Hakyll/Web/Feed.hs +++ b/src/Hakyll/Web/Feed.hs @@ -7,11 +7,11 @@ -- Also note that the pages should have (at least) the following fields to -- produce a correct feed: -- --- - @$title@: Title of the item +-- - @$title$@: Title of the item -- --- - @$description@: Description to appear in the feed +-- - @$description$@: Description to appear in the feed -- --- - @$url@: URL to the item - this is usually set automatically. +-- - @$url$@: URL to the item - this is usually set automatically. -- -- In addition, the posts should be named according to the rules for -- 'Hakyll.Page.Metadata.renderDateField'. diff --git a/tests/Hakyll/Web/Page/Metadata/Tests.hs b/tests/Hakyll/Web/Page/Metadata/Tests.hs index 6fbd89a..f14bfec 100644 --- a/tests/Hakyll/Web/Page/Metadata/Tests.hs +++ b/tests/Hakyll/Web/Page/Metadata/Tests.hs @@ -42,6 +42,15 @@ tests = concat $ setFieldA "bar" (map toLower) (mempty, "FOO") ] + , fromAssertions "renderDateField" + [ (@=?) "January 31, 2010" $ getField "date" $ renderDateField + "date" "%B %e, %Y" "Date unknown" $ Page + (M.singleton "path" "/posts/2010-01-31-a-post.mkdwn") "" + , (@=?) "Date unknown" $ getField "date" $ renderDateField + "date" "%B %e, %Y" "Date unknown" $ Page + (M.singleton "path" "/posts/a-post.mkdwn") "" + ] + , fromAssertions "copyBodyToField" [ (Page (M.singleton "bar" "foo") "foo") @=? copyBodyToField "bar" (Page M.empty "foo") |