Created
January 13, 2014 14:32
-
-
Save jtanguy/8401281 to your computer and use it in GitHub Desktop.
Redirects within hakyll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match "redirects.txt" $ do | |
route $ constRoute ".htaccess" | |
compile $ makeItem "" >>= | |
loadAndApplyTemplate "templates-htaccess" myCtx | |
where | |
myCtx = metadataField `mappend` | |
defaultContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
redirects: | |
- old: "/my/old/path.html" | |
new: "/my/new/path.html" | |
- old: "/my/other/old/path.html" | |
new: "/my/new/other/path.html" | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$for(redirects)$ | |
Redirect 301 $old$ $siteRoot$$new$ | |
$endfor$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment