aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-10-20 09:25:23 +0200
committerMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-10-20 09:25:49 +0200
commitcabb492b34d967b9e9fb1227aa21ea1b8d4d4f35 (patch)
tree8797b4713977db1a9b91d41b3b1e44b142774b3a
parentb63146f517eb8ef1fb6da85e625de1d689d90eed (diff)
downloadreploy-cabb492b34d967b9e9fb1227aa21ea1b8d4d4f35.tar.gz
reploy-cabb492b34d967b9e9fb1227aa21ea1b8d4d4f35.tar.bz2
fix the page naming lambda, add demo
closes #18
-rw-r--r--reploy.hs5
-rw-r--r--templates/header.html3
2 files changed, 5 insertions, 3 deletions
diff --git a/reploy.hs b/reploy.hs
index 13dff27..78574d4 100644
--- a/reploy.hs
+++ b/reploy.hs
@@ -190,8 +190,9 @@ pageName' :: Site (FilePath -> String)
pageName' = do
ps <- use pages
pure $ \mnt' ->
- just ("template looks for undefined page name : " ++ mnt')
- $ ps M.!? unAbsolute mnt' >>= (^? pageMeta . key "template" . _String . to T.unpack)
+ just ("lookup for undefined page name : " ++ mnt')
+ $ ps M.!? unAbsolute mnt'
+ >>= (^? pageMeta . key "name" . _String . to T.unpack)
-- | Like `Mu.substitute` but writes (and eventually should throw) stuff on errors
checkedSubstitute :: Mu.Template -> MT.Value -> IO T.Text
diff --git a/templates/header.html b/templates/header.html
index 1afc80e..d4e4799 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -1,9 +1,10 @@
<header>
Navigation:
<ul>
+ <li><a href="{{#pageLink}}/{{/pageLink}}">{{#pageName}}/{{/pageName}}</a></li>
<li><a href="{{#pageLink}}/tag{{/pageLink}}">Tags</a></li>
<li><a href="{{#pageLink}}/list{{/pageLink}}">List</a></li>
- <li><a href="{{#pageLink}}/search{{/pageLink}}">Search</a></li>
+ <li><a href="{{#pageLink}}/search{{/pageLink}}">{{#pageName}}/search{{/pageName}}</a></li>
</ul>
{{?htags}}