Compare commits
3 Commits
59cf230683
...
a49af625bf
Author | SHA1 | Date | |
---|---|---|---|
a49af625bf | |||
7056ca822c | |||
7e290bee2f |
@ -109,6 +109,12 @@ 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;
|
||||||
|
23
rauhala.info/projects/2021-01-21-phrase.md
Normal file
23
rauhala.info/projects/2021-01-21-phrase.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
```
|
@ -16,6 +16,9 @@
|
|||||||
<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>
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
A list of small and big guides.
|
|
||||||
|
|
||||||
$partial("templates/post-list.html")$
|
|
@ -1,7 +1,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
$for(posts)$
|
$for(items)$
|
||||||
<li>
|
<li>
|
||||||
<a href="$url$">$title$</a> - $modified$
|
<a href="$url$">$title$</a> - $date$
|
||||||
</li>
|
</li>
|
||||||
$endfor$
|
$endfor$
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
<article>
|
<article>
|
||||||
<section class="header">
|
<section class="header">
|
||||||
Posted on $date$, modified on $modified$
|
Posted on $date$
|
||||||
$if(author)$
|
|
||||||
by $author$
|
|
||||||
$endif$
|
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
$body$
|
$body$
|
||||||
|
8
rauhala.info/templates/project-list.html
Normal file
8
rauhala.info/templates/project-list.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<ul>
|
||||||
|
$for(items)$
|
||||||
|
<li>
|
||||||
|
<div class="projectlist"><a href="$url$">$title$</a>$if(badge)$<img src="$badge$" />$endif$</div>
|
||||||
|
</li>
|
||||||
|
$endfor$
|
||||||
|
</ul>
|
||||||
|
|
6
rauhala.info/templates/project.html
Normal file
6
rauhala.info/templates/project.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<article>
|
||||||
|
<section>
|
||||||
|
$body$
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
|
|
@ -1,14 +1,18 @@
|
|||||||
--------------------------------------------------------------------------------
|
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE StrictData #-}
|
||||||
import Hakyll
|
import Hakyll
|
||||||
|
|
||||||
import Data.List
|
import Data.List
|
||||||
(isSuffixOf)
|
(isPrefixOf, isSuffixOf)
|
||||||
|
|
||||||
|
import System.FilePath
|
||||||
|
(takeFileName)
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hakyllWith defaultConfiguration $ do
|
main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
|
||||||
match "well-known/*" $ do
|
match "well-known/*" $ do
|
||||||
route (customRoute (prepend '.'. toFilePath))
|
route (customRoute (prepend '.'. toFilePath))
|
||||||
compile copyFileCompiler
|
compile copyFileCompiler
|
||||||
@ -29,16 +33,75 @@ main = hakyllWith defaultConfiguration $ 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 = (:)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{ mkDerivation, base, hakyll, stdenv, time }:
|
{ mkDerivation, base, filepath, 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 hakyll time ];
|
executableHaskellDepends = [ base filepath hakyll time ];
|
||||||
license = stdenv.lib.licenses.bsd3;
|
license = stdenv.lib.licenses.bsd3;
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,6 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user