Browse Source

Renaming posts to events

main
Sam Hatfield 11 months ago
parent
commit
98b869c5f8
Signed by: sehqlr GPG Key ID: 7338CA919BC087F3
  1. 0
      events/2015-08-12-spqr.markdown
  2. 0
      events/2015-10-07-rosa-rosa-rosam.markdown
  3. 0
      events/2015-11-28-carpe-diem.markdown
  4. 0
      events/2015-12-07-tu-quoque.markdown
  5. 4
      index.html
  6. 23
      site.hs
  7. 2
      templates/archive.html
  8. 15
      templates/default.html
  9. 2
      templates/events-list.html
  10. 0
      templates/events.html

0
posts/2015-08-12-spqr.markdown → events/2015-08-12-spqr.markdown

0
posts/2015-10-07-rosa-rosa-rosam.markdown → events/2015-10-07-rosa-rosa-rosam.markdown

0
posts/2015-11-28-carpe-diem.markdown → events/2015-11-28-carpe-diem.markdown

0
posts/2015-12-07-tu-quoque.markdown → events/2015-12-07-tu-quoque.markdown

4
index.html

@ -4,13 +4,11 @@ title: Home
<h2>Welcome</h2>
<img src="/images/haskell-logo.png" style="float: right; margin: 10px;" />
<p>Welcome to my blog!</p>
<p>I've reproduced a list of recent posts here for your reading pleasure:</p>
<h2>Posts</h2>
$partial("templates/post-list.html")$
$partial("templates/events-list.html")$
<p>…or you can find more in the <a href="/archive.html">archives</a>.</p>

23
site.hs

@ -21,20 +21,20 @@ main = hakyll $ do
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "posts/*" $ do
match "events/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= loadAndApplyTemplate "templates/events.html" pageCtx
>>= loadAndApplyTemplate "templates/default.html" pageCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
events <- recentFirst =<< loadAll "events/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
listField "events" pageCtx (return events) `mappend`
constField "title" "Archives" `mappend`
defaultContext
makeItem ""
@ -42,14 +42,13 @@ main = hakyll $ do
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "index.html" $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
events <- recentFirst =<< loadAll "events/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
listField "events" pageCtx (return events) `mappend`
constField "title" "Home" `mappend`
defaultContext
getResourceBody
@ -61,7 +60,7 @@ main = hakyll $ do
--------------------------------------------------------------------------------
postCtx :: Context String
postCtx =
pageCtx :: Context String
pageCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext

2
templates/archive.html

@ -1,2 +1,2 @@
Here you can find all my previous posts:
$partial("templates/post-list.html")$
$partial("templates/events-list.html")$

15
templates/default.html

@ -4,19 +4,18 @@
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Hakyll Blog - $title$</title>
<title>St. Louis Haskell Users Group - $title$</title>
<link rel="stylesheet" href="/css/default.css" />
</head>
<body>
<header>
<div class="logo">
<a href="/">My Hakyll Blog</a>
<a href="/">St. Louis Haskell Users Group</a>
</div>
<nav>
<a href="/">Home</a>
<a href="/about.html">About</a>
<a href="/contact.html">Contact</a>
<a href="/archive.html">Archive</a>
<a href="/about.html">About Us</a>
<a href="/calendar.html">Calendar</a>
<a href="/attend.html">Attend</a>
</nav>
</header>
@ -26,7 +25,9 @@
</main>
<footer>
Site proudly generated by
Site designed by
<a href="https://samhatfield.me">samhatfield.me</a>
and proudly generated by
<a href="http://jaspervdj.be/hakyll">Hakyll</a>
</footer>
</body>

2
templates/post-list.html → templates/events-list.html

@ -1,5 +1,5 @@
<ul>
$for(posts)$
$for(events)$
<li>
<a href="$url$">$title$</a> - $date$
</li>

0
templates/post.html → templates/events.html

Loading…
Cancel
Save