From 2019e64ba2bbf9e2e1014716750e99a39000462d Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Wed, 30 Oct 2024 20:44:21 +0100 Subject: [PATCH] Let the front page redirect to the newest recipe --- byg/src/SiteGenerator.hs | 4 ++++ om.md | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/byg/src/SiteGenerator.hs b/byg/src/SiteGenerator.hs index 1271d30..1ad616b 100644 --- a/byg/src/SiteGenerator.hs +++ b/byg/src/SiteGenerator.hs @@ -129,6 +129,10 @@ generateSite = do atomText <- generateAtom newest infos 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 outputAboutDir <- joinPaths outputDir (inject "om") makeDir outputAboutDir diff --git a/om.md b/om.md index 8dfab2a..9c76cd5 100644 --- a/om.md +++ b/om.md @@ -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. +## Atom-feed + +i din læser + + ## Licens

Niels' mad by Niels G. W. Serup er licenseret under CC BY-SA 4.0