Compare commits

..

No commits in common. "a49af625bff391778a297915cb9c60b94feb4d51" and "59cf2306836758f656d1c9a0f8d6d685b0d991d7" have entirely different histories.

11 changed files with 14 additions and 118 deletions

View File

@ -109,12 +109,6 @@ article .header {
}
}
.projectlist {
display: flex;
align-items: center;
justify-content: space-between;
}
@media (min-width: 640px) {
body {
width: 60rem;

View File

@ -1,23 +0,0 @@
---
title: phrase
github: https://github.com/MasseR/phrase
issues: https://github.com/MasseR/phrase/issues
badge: https://github.com/MasseR/phrase/workflows/Run nix build/badge.svg
---
This project is a command line tool for generating password phrases using the
[diceware method](https://diceware.dmuth.org/). The passwords are stored in a
folder structure that is compatible with the
[pass](https://www.passwordstore.org/) password store manager.
```
$ phrase asd
inlet area crux
$ pass show asd
inlet area crux
$ file ~/.password-store/asd.gpg
```

View File

@ -16,9 +16,6 @@
<nav>
<!-- Git logo from https://git-scm.com/downloads/logos -->
<!-- Logo by Jason Long -->
<a href="/">Home</a>
<a href="/posts.html">Posts</a>
<a href="/projects.html">Projects</a>
<a href="https://git.rauhala.info"><img src="/images/git_16.png" alt="git" /></a>
<a href="/contact.html">Contact</a>
</nav>

View File

@ -0,0 +1,3 @@
A list of small and big guides.
$partial("templates/post-list.html")$

View File

@ -1,7 +1,7 @@
<ul>
$for(items)$
$for(posts)$
<li>
<a href="$url$">$title$</a> - $date$
<a href="$url$">$title$</a> - $modified$
</li>
$endfor$
</ul>

View File

@ -1,6 +1,9 @@
<article>
<section class="header">
Posted on $date$
Posted on $date$, modified on $modified$
$if(author)$
by $author$
$endif$
</section>
<section>
$body$

View File

@ -1,8 +0,0 @@
<ul>
$for(items)$
<li>
<div class="projectlist"><a href="$url$">$title$</a>$if(badge)$<img src="$badge$" />$endif$</div>
</li>
$endfor$
</ul>

View File

@ -1,6 +0,0 @@
<article>
<section>
$body$
</section>
</article>

View File

@ -1,18 +1,14 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
import Hakyll
import Data.List
(isPrefixOf, isSuffixOf)
import System.FilePath
(takeFileName)
(isSuffixOf)
--------------------------------------------------------------------------------
main :: IO ()
main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
main = hakyllWith defaultConfiguration $ do
match "well-known/*" $ do
route (customRoute (prepend '.'. toFilePath))
compile copyFileCompiler
@ -33,75 +29,16 @@ main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
route idRoute
compile compressCssCompiler
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "projects/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/project.html" postContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match (fromList ["index.markdown", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
archive $ Archive { output = "posts.html"
, input = "posts/*"
, title = "Posts"
, template = "templates/post-list.html"
, context = postContext
}
archive $ Archive { output = "projects.html"
, input = "projects/*"
, title = "Projects"
, template = "templates/project-list.html"
, context = postContext
}
match "templates/*" $ compile templateBodyCompiler
where
postContext :: Context String
postContext = dateField "date" "%B %e, %Y" <> defaultContext
ignore :: FilePath -> Bool
ignore path = any ($ takeFileName path)
[ ("." `isPrefixOf`)
, ("#" `isPrefixOf`)
, ("~" `isSuffixOf`)
, (".swp" `isSuffixOf`)
]
data Archive
= Archive { output :: Identifier
, input :: Pattern
, title :: String
, template :: Identifier
, context :: Context String
}
archive :: Archive -> Rules ()
archive Archive{..} = create [output] $ do
route idRoute
compile $ do
let itemsContext =
listField "items" context items
<> constField "title" title
<> defaultContext
items = recentFirst =<< loadAll input
makeItem ""
>>= loadAndApplyTemplate template itemsContext
>>= loadAndApplyTemplate "templates/default.html" itemsContext
>>= relativizeUrls
prepend :: a -> [a] -> [a]
prepend = (:)

View File

@ -1,10 +1,10 @@
{ mkDerivation, base, filepath, hakyll, stdenv, time }:
{ mkDerivation, base, hakyll, stdenv, time }:
mkDerivation {
pname = "site";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base filepath hakyll time ];
executableHaskellDepends = [ base hakyll time ];
license = stdenv.lib.licenses.bsd3;
}

View File

@ -13,6 +13,5 @@ executable site
build-depends: base == 4.*
, hakyll >= 4.10
, time
, filepath
ghc-options: -threaded
default-language: Haskell2010