dont create dropdown on singleton tag entries

This commit is contained in:
Sarah Vaupel 2023-10-27 20:38:25 +02:00
parent 4f2868fad5
commit 2be63d85a8
2 changed files with 10 additions and 1 deletions

View File

@ -192,8 +192,12 @@ main =
, constField "route" navRoute , constField "route" navRoute
, listField "posts" (constField "tag" tag' <> constField "route" navRoute <> postContext) (metadataSort =<< mapM load ids) , 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' tagItem'
>>= loadAndApplyTemplate "templates/tag-nav.html" tagNavCtx >>= loadAndApplyTemplate tagNavTemplate tagNavCtx
>>= normalizeUrls >>= normalizeUrls
postContext = postContext =
mconcat mconcat

View File

@ -0,0 +1,5 @@
<li class="nav-link">
<a class="nav-link" href="$route$">
$title$
</a>
</li>