Let the front page redirect to the newest recipe

This commit is contained in:
Niels G. W. Serup 2024-10-30 20:44:21 +01:00
parent 8b3af9e8f3
commit 2019e64ba2
No known key found for this signature in database
GPG Key ID: 38EEEBCE67324F19
2 changed files with 9 additions and 0 deletions

View File

@ -129,6 +129,10 @@ generateSite = do
atomText <- generateAtom newest infos atomText <- generateAtom newest infos
saveTextFile atomText (joinPaths outputDir (inject "atom.xml")) saveTextFile atomText (joinPaths outputDir (inject "atom.xml"))
redirectTemplate <- makeTemplate (readTextFile (inject "redirect.html")) (inject "URL")
newestSlug <- onToken (T.pack . snd . head') infos
saveTextFile (applyTemplate redirectTemplate newestSlug) (joinPaths outputDir indexName)
-- Handle about page -- Handle about page
outputAboutDir <- joinPaths outputDir (inject "om") outputAboutDir <- joinPaths outputDir (inject "om")
makeDir outputAboutDir makeDir outputAboutDir

5
om.md
View File

@ -18,6 +18,11 @@ Da jeg i 2012 flyttede hjemmefra for at studere i København, begyndte jeg også
Klik på [Retter](/retter)-fanen i toppen af siden for at se alle mine madretter. Klik på [Retter](/retter)-fanen i toppen af siden for at se alle mine madretter.
## Atom-feed
i din læser
## Licens ## Licens
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><span property="dct:title">Niels' mad</span> by <span property="cc:attributionName">Niels G. W. Serup</span> er licenseret under <a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-SA 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1" alt=""></a></p> <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><span property="dct:title">Niels' mad</span> by <span property="cc:attributionName">Niels G. W. Serup</span> er licenseret under <a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-SA 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1" alt=""></a></p>