use pandoc default files for metadata and applying templates as needed

This commit is contained in:
Tim Schubert 2021-08-18 23:49:49 +02:00
parent 39db7ded7d
commit 12fc6478e1
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
17 changed files with 50 additions and 30 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
build/
*.html *.html
result result

View file

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
find . -iname "*.md" -type f -exec sh -c 'pandoc -s -f markdown -t html --template=src/template.html -o "${0%.md}.html" "${0}"' {} \; find src -type d -exec sh -c 'srcpath="$(realpath ${0})"; outpath=$(realpath "build${0#src}"); echo "src=$srcpath; dst=$outpath"; mkdir -p "$outpath" && cd "$srcpath" && pandoc -d "${srcpath}/defaults.pandoc" -o "${outpath}/index.html" ' {} \;

View file

@ -2,5 +2,5 @@
with pkgs; with pkgs;
{ {
this = callPackage ./default.nix { }; this = callPackage ./nix { };
} }

8
src/blog/defaults.pandoc Normal file
View file

@ -0,0 +1,8 @@
defaults:
- ../defaults.pandoc
input-files:
- index.md
template: ../template.html
metadata:
title: dadada's Blog

View file

@ -0,0 +1,3 @@
defaults: ../../defaults.pandoc
metadata:
title: Managing stripped GPG keys

View file

@ -1,7 +1,3 @@
---
title: Managing stripped GPG keys
...
*2017-12-03* *2017-12-03*
``` ```

View file

@ -0,0 +1,3 @@
defaults: ../../defaults.pandoc
metadata:
title: My $HOME

View file

@ -1,7 +1,3 @@
---
title: My $HOME
...
*2018-09-03* *2018-09-03*
Recently, I came across a blog posting titled "[$HOME, sweet $HOME](https://morr.cc/home-sweet-home/)", where [@blinry](https://morr.cc/) advocates for structuring your `$HOME` directory based on projects and their activity. Recently, I came across a blog posting titled "[$HOME, sweet $HOME](https://morr.cc/home-sweet-home/)", where [@blinry](https://morr.cc/) advocates for structuring your `$HOME` directory based on projects and their activity.

View file

@ -1,6 +1,2 @@
---
title: Blogs
...
- [Managing stripped GPG keys](gpg/) - [Managing stripped GPG keys](gpg/)
- [My $HOME](home-layout/) - [My $HOME](home-layout/)

13
src/defaults.pandoc Normal file
View file

@ -0,0 +1,13 @@
# Fallbacks
from: markdown
to: html5
input-files:
- index.md
standalone: true
metadata:
author:
- dadada
title: dadada

View file

@ -1,7 +1,3 @@
---
title: dadada
...
**Welcome to my personal homepage ;-)** **Welcome to my personal homepage ;-)**
## About this page ## About this page

View file

@ -0,0 +1,8 @@
defaults:
- ../defaults.pandoc
input-files:
- index.md
template: ../template.html
metadata:
title: dadada's projects

View file

@ -1,7 +1,3 @@
---
title: Projects
...
See also my [GitHub](https://github.com/dadada) and [Gitlab](https://gitlab.com/dadada_). See also my [GitHub](https://github.com/dadada) and [Gitlab](https://gitlab.com/dadada_).
## Contributions ## Contributions

View file

@ -0,0 +1,8 @@
defaults:
- ../defaults.pandoc
input-files:
- index.md
template: ../template.html
metadata:
title: dadada's Talks

View file

@ -1,5 +1 @@
---
title: Talks
...
- [systemd.generator(7)](systemd.generator/) - [systemd.generator(7)](systemd.generator/)

View file

@ -0,0 +1,3 @@
defaults: ../../defaults.pandoc
metadata:
title: systemd.generator(7)

View file

@ -1,7 +1,3 @@
---
title: systemd.generator(7)
...
*2019-03-14* *2019-03-14*
[Recording](https://www.youtube.com/watch?v=X88zHJjodFw) [Recording](https://www.youtube.com/watch?v=X88zHJjodFw)