diff --git a/src/Main.hs b/src/Main.hs index 0dc75de..14d9e12 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -192,8 +192,12 @@ main = , constField "route" navRoute , listField "posts" (constField "tag" tag' <> constField "route" navRoute <> postContext) (metadataSort =<< mapM load ids) ] + + tagNavTemplate + | length ids > 1 = "templates/tag-nav.html" + | otherwise = "templates/tag-nav-singleton.html" tagItem' - >>= loadAndApplyTemplate "templates/tag-nav.html" tagNavCtx + >>= loadAndApplyTemplate tagNavTemplate tagNavCtx >>= normalizeUrls postContext = mconcat diff --git a/templates/tag-nav-singleton.html b/templates/tag-nav-singleton.html new file mode 100644 index 0000000..e64d4d3 --- /dev/null +++ b/templates/tag-nav-singleton.html @@ -0,0 +1,5 @@ +