Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
title: Home
|
||||
home: true
|
||||
---
|
||||
|
||||
<h2>Welcome</h2>
|
||||
$partial("templates/post-preview-list.html")$
|
||||
<p>Find more in the <a href="/archive.html">archives</a>.</p>
|
||||
|
30
src/site.hs
30
src/site.hs
@@ -80,6 +80,31 @@ main = hakyllWith config $ do
|
||||
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
|
||||
>>= relativizeUrls
|
||||
|
||||
match "dailies/*org" $ do
|
||||
route $ setExtension "html"
|
||||
compile $ do
|
||||
pandocCompiler
|
||||
>>= saveSnapshot "dailiescontent"
|
||||
>>= loadAndApplyTemplate "templates/post.html" dailiesCtx
|
||||
>>= loadAndApplyTemplate "templates/default.html" dailiesCtx
|
||||
>>= relativizeUrls
|
||||
|
||||
create ["dailies.html"] $ do
|
||||
route idRoute
|
||||
compile $ do
|
||||
dailyToday <- fmap (take 1) . recentFirst =<< loadAllSnapshots "dailies/*" "dailiescontent"
|
||||
dailies <- recentFirst =<< loadAll "dailies/*"
|
||||
let dailiesCtx' =
|
||||
listField "today" dailiesCtx (return dailyToday)
|
||||
<> listField "posts" dailiesCtx (return dailies)
|
||||
<> constField "title" "Dailies"
|
||||
<> defaultCtx
|
||||
|
||||
makeItem ""
|
||||
>>= loadAndApplyTemplate "templates/dailies.html" dailiesCtx'
|
||||
>>= loadAndApplyTemplate "templates/default.html" dailiesCtx'
|
||||
>>= relativizeUrls
|
||||
|
||||
match "index.html" $ do
|
||||
route idRoute
|
||||
compile $ do
|
||||
@@ -144,6 +169,11 @@ postCtx tags =
|
||||
<> teaserField "teaser" "content"
|
||||
<> defaultCtx
|
||||
|
||||
dailiesCtx :: Context String
|
||||
dailiesCtx =
|
||||
dateField "date" "%B %e, %Y"
|
||||
<> defaultCtx
|
||||
|
||||
defaultCtx :: Context String
|
||||
defaultCtx =
|
||||
listField "subdomains" subCtx (return subdomains)
|
||||
|
14
templates/dailies.html
Normal file
14
templates/dailies.html
Normal file
@@ -0,0 +1,14 @@
|
||||
$for(today)$
|
||||
<article>
|
||||
<h1 class="post-title">$title$</h1>
|
||||
<div class="post-teaser">
|
||||
$body$
|
||||
</div>
|
||||
<hr>
|
||||
</article>
|
||||
$endfor$
|
||||
|
||||
<p>
|
||||
<h3> Previous Dailies: </h3>
|
||||
</p>
|
||||
$partial("templates/post-list.html")$
|
@@ -17,6 +17,7 @@
|
||||
<a href="/about.html">About</a>
|
||||
<a href="/contact.html">Contact</a>
|
||||
<a href="/archive.html">Archive</a>
|
||||
<a href="/dailies.html">Dailies</a>
|
||||
<a href="/links.html">Links</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
Reference in New Issue
Block a user