feat: add rss link alternate tag to head

This commit is contained in:
Robert W. Pearce 2023-02-23 21:57:39 +13:00
parent 9a4b698d68
commit 372422ab18
No known key found for this signature in database
GPG key ID: 8EE70FB52D805C55
2 changed files with 7 additions and 1 deletions

View file

@ -39,6 +39,10 @@
<link rel="shortcut icon" href="/favicon.ico">
<link rel="canonical" href="$root$$url$">
<link rel="alternate" href="./atom.xml" title="$feedTitle$" type="application/atom+xml">
<link rel="alternate" href="./rss.xml" title="$feedTitle$" type="application/rss+xml">
<link rel="stylesheet" href="./css/default.css" />
<link rel="stylesheet" href="./css/code.css" />
</head>

View file

@ -29,7 +29,7 @@ mySiteRoot :: String
mySiteRoot = "https://my-site.com"
myFeedTitle :: String
myFeedTitle = "My Site"
myFeedTitle = "My Feed Title"
myFeedDescription :: String
myFeedDescription = "My Site Description"
@ -108,6 +108,7 @@ main = hakyllWith config $ do
let indexCtx =
listField "posts" postCtx (return posts)
<> constField "root" mySiteRoot
<> constField "feedTitle" myFeedTitle
<> constField "siteName" mySiteName
<> defaultContext
@ -163,6 +164,7 @@ feedCtx =
postCtx :: Context String
postCtx =
constField "root" mySiteRoot
<> constField "feedTitle" myFeedTitle
<> constField "siteName" mySiteName
<> dateField "date" "%Y-%m-%d"
<> defaultContext