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) { @media (min-width: 640px) {
body { body {
width: 60rem; 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> <nav>
<!-- Git logo from https://git-scm.com/downloads/logos --> <!-- Git logo from https://git-scm.com/downloads/logos -->
<!-- Logo by Jason Long --> <!-- 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="https://git.rauhala.info"><img src="/images/git_16.png" alt="git" /></a>
<a href="/contact.html">Contact</a> <a href="/contact.html">Contact</a>
</nav> </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> <ul>
$for(items)$ $for(posts)$
<li> <li>
<a href="$url$">$title$</a> - $date$ <a href="$url$">$title$</a> - $modified$
</li> </li>
$endfor$ $endfor$
</ul> </ul>

View File

@ -1,6 +1,9 @@
<article> <article>
<section class="header"> <section class="header">
Posted on $date$ Posted on $date$, modified on $modified$
$if(author)$
by $author$
$endif$
</section> </section>
<section> <section>
$body$ $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 OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
import Hakyll import Hakyll
import Data.List import Data.List
(isPrefixOf, isSuffixOf) (isSuffixOf)
import System.FilePath
(takeFileName)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
main :: IO () main :: IO ()
main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do main = hakyllWith defaultConfiguration $ do
match "well-known/*" $ do match "well-known/*" $ do
route (customRoute (prepend '.'. toFilePath)) route (customRoute (prepend '.'. toFilePath))
compile copyFileCompiler compile copyFileCompiler
@ -33,75 +29,16 @@ main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
route idRoute route idRoute
compile compressCssCompiler 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 match (fromList ["index.markdown", "contact.markdown"]) $ do
route $ setExtension "html" route $ setExtension "html"
compile $ pandocCompiler compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext >>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls >>= 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 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 :: a -> [a] -> [a]
prepend = (:) prepend = (:)

View File

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

View File

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