Merge pull request #44 from rpearce/feat/rss-and-minor-changes

feat: rss link alternate and minor changes
This commit is contained in:
Robert Pearce 2023-02-23 22:08:30 +13:00 committed by GitHub
commit cae75cb327
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View file

@ -1,3 +1,3 @@
;(function(w, d) {
console.log('Hello, world!', w, d)
})(window, document);
;(function() {
console.log('Hello, world!');
})();

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

@ -5,10 +5,7 @@
<a href=".$url$">$title$</a>
</h1>
<div>
<small>$date$</small>
$if(updated)$
<small>(updated: $updated$)</small>
$endif$
$date$ $if(updated)$(updated: $updated$)$endif$
</div>
</header>
<section>

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