-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f96cacb
Showing
10 changed files
with
285 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_cache | ||
_site | ||
dist-newstyle |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: blog | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >= 1.10 | ||
|
||
executable site | ||
main-is: site.hs | ||
build-depends: base == 4.* | ||
, hakyll == 4.15.* | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
default-language: Haskell2010 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
html { | ||
font-size: 62.5%; | ||
} | ||
|
||
body { | ||
font-size: 1.6rem; | ||
color: #000; | ||
} | ||
|
||
header { | ||
border-bottom: 0.2rem solid #000; | ||
} | ||
|
||
nav { | ||
text-align: right; | ||
} | ||
|
||
nav a { | ||
font-size: 1.8rem; | ||
font-weight: bold; | ||
color: black; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
} | ||
|
||
footer { | ||
margin-top: 3rem; | ||
padding: 1.2rem 0; | ||
border-top: 0.2rem solid #000; | ||
font-size: 1.2rem; | ||
color: #555; | ||
} | ||
|
||
h1 { | ||
font-size: 2.4rem; | ||
} | ||
|
||
h2 { | ||
font-size: 2rem; | ||
} | ||
|
||
article .header { | ||
font-size: 1.4rem; | ||
font-style: italic; | ||
color: #555; | ||
} | ||
|
||
.logo a { | ||
font-weight: bold; | ||
color: #000; | ||
text-decoration: none; | ||
} | ||
|
||
@media (max-width: 319px) { | ||
body { | ||
width: 90%; | ||
margin: 0; | ||
padding: 0 5%; | ||
} | ||
header { | ||
margin: 4.2rem 0; | ||
} | ||
nav { | ||
margin: 0 auto 3rem; | ||
text-align: center; | ||
} | ||
footer { | ||
text-align: center; | ||
} | ||
.logo { | ||
text-align: center; | ||
margin: 1rem auto 3rem; | ||
} | ||
.logo a { | ||
font-size: 2.4rem; | ||
} | ||
nav a { | ||
display: block; | ||
line-height: 1.6; | ||
} | ||
} | ||
|
||
@media (min-width: 320px) { | ||
body { | ||
width: 90%; | ||
margin: 0; | ||
padding: 0 5%; | ||
} | ||
header { | ||
margin: 4.2rem 0; | ||
} | ||
nav { | ||
margin: 0 auto 3rem; | ||
text-align: center; | ||
} | ||
footer { | ||
text-align: center; | ||
} | ||
.logo { | ||
text-align: center; | ||
margin: 1rem auto 3rem; | ||
} | ||
.logo a { | ||
font-size: 2.4rem; | ||
} | ||
nav a { | ||
display: inline; | ||
margin: 0 0.6rem; | ||
} | ||
} | ||
|
||
@media (min-width: 640px) { | ||
body { | ||
width: 60rem; | ||
margin: 0 auto; | ||
padding: 0; | ||
} | ||
header { | ||
margin: 0 0 3rem; | ||
padding: 1.2rem 0; | ||
} | ||
nav { | ||
margin: 0; | ||
text-align: right; | ||
} | ||
nav a { | ||
margin: 0 0 0 1.2rem; | ||
display: inline; | ||
} | ||
footer { | ||
text-align: right; | ||
} | ||
.logo { | ||
margin: 0; | ||
text-align: left; | ||
} | ||
.logo a { | ||
float: left; | ||
font-size: 1.8rem; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: No Ink Involved | ||
--- | ||
|
||
<h2>Ironically, there is no ink involved with this site.</h2> | ||
|
||
<img src="/images/haskell-logo.png" style="float: right; margin: 10px;" /> | ||
|
||
<h2>Posts</h2> | ||
$partial("templates/post-list.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
-------------------------------------------------------------------------------- | ||
{-# LANGUAGE OverloadedStrings #-} | ||
import Data.Monoid (mappend) | ||
import Hakyll | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
main :: IO () | ||
main = hakyll $ do | ||
match "images/*" $ do | ||
route idRoute | ||
compile copyFileCompiler | ||
|
||
match "css/*" $ do | ||
route idRoute | ||
compile compressCssCompiler | ||
|
||
{- match (fromList ["about.rst", "contact.markdown"]) $ do | ||
route $ setExtension "html" | ||
compile $ pandocCompiler | ||
>>= loadAndApplyTemplate "templates/default.html" defaultContext | ||
>>= relativizeUrls -} | ||
|
||
match "posts/*" $ do | ||
route $ setExtension "html" | ||
compile $ pandocCompiler | ||
>>= loadAndApplyTemplate "templates/post.html" postCtx | ||
>>= loadAndApplyTemplate "templates/default.html" postCtx | ||
>>= relativizeUrls | ||
|
||
{- create ["archive.html"] $ do | ||
route idRoute | ||
compile $ do | ||
posts <- recentFirst =<< loadAll "posts/*" | ||
let archiveCtx = | ||
listField "posts" postCtx (return posts) `mappend` | ||
constField "title" "Archives" `mappend` | ||
defaultContext | ||
makeItem "" | ||
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx | ||
>>= loadAndApplyTemplate "templates/default.html" archiveCtx | ||
>>= relativizeUrls -} | ||
|
||
|
||
match "index.html" $ do | ||
route idRoute | ||
compile $ do | ||
posts <- recentFirst =<< loadAll "posts/*" | ||
let indexCtx = | ||
listField "posts" postCtx (return posts) `mappend` | ||
defaultContext | ||
|
||
getResourceBody | ||
>>= applyAsTemplate indexCtx | ||
>>= loadAndApplyTemplate "templates/default.html" indexCtx | ||
>>= relativizeUrls | ||
|
||
match "templates/*" $ compile templateBodyCompiler | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
postCtx :: Context String | ||
postCtx = | ||
dateField "date" "%B %e, %Y" `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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Here you can find all my previous posts: | ||
$partial("templates/post-list.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<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> | ||
<link rel="stylesheet" href="/css/default.css" /> | ||
</head> | ||
<body> | ||
<header> | ||
<div class="logo"> | ||
<a href="/">My Hakyll Blog</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> | ||
</nav> | ||
</header> | ||
|
||
<main role="main"> | ||
<h1>$title$</h1> | ||
$body$ | ||
</main> | ||
|
||
<footer> | ||
Site proudly generated by | ||
<a href="http://jaspervdj.be/hakyll">Hakyll</a> | ||
</footer> | ||
</body> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<ul> | ||
$for(posts)$ | ||
<li> | ||
<a href="$url$">$title$</a> - $date$ | ||
</li> | ||
$endfor$ | ||
</ul> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<article> | ||
<section class="header"> | ||
Posted on $date$ | ||
$if(author)$ | ||
by $author$ | ||
$endif$ | ||
</section> | ||
<section> | ||
$body$ | ||
</section> | ||
</article> |