new style + some posts

This commit is contained in:
rhiannon morris 2024-12-05 06:41:29 +01:00
parent 2d53d00d20
commit 8f8150eaac
21 changed files with 847 additions and 788 deletions

View file

@ -61,8 +61,8 @@ getTags file = do
makeYAML :: [Set Text] -> LazyBS.ByteString
makeYAML tags = "---\n" <> yaml <> "\n...\n" where
yaml = YAML.encode1 $ YAML.obj
[("title" ##= YAML.str "all tags"),
("all-tags" ##= collate tags)]
["title" ##= YAML.str "all tags", "meta" ##= True,
"all-tags" ##= collate tags]
-- | generates a makefile to include that generates the index and individual
-- tag pages. example:
@ -112,7 +112,7 @@ data Tag =
instance YAML.ToYAML Tag where
toYAML (Tag {name, slug, count}) = YAML.obj $
[("name" ##= name), ("slug" ##= slug), ("count" ##= count)]
["name" ##= name, "slug" ##= slug, "count" ##= count]
-- | counts occurrences of each tag, and checks they all have distinct slugs
collate :: [Set Text] -> [Tag]

View file

@ -64,7 +64,7 @@ makeTagInfo infos title basename outdir = do
makeContent :: Text -> [PostInfo] -> LazyBS.ByteString
makeContent title is' = "---\n" <> YAML.encode1 val <> "...\n" where
is = sortBy (flip $ comparing date) is'
val = YAML.obj [("title" ##= title), ("posts" ##= is)]
val = YAML.obj ["title" ##= title, "posts" ##= is, "meta" ##= True]
allTags :: Foldable t => t PostInfo -> Set Text
allTags = foldMap (Set.fromList . tags)