From 1135a850736d5c1ecb2b2b49e457658d79165620 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Sun, 9 Jun 2019 16:02:38 +0200 Subject: [PATCH] Add Tup generator --- .gitignore | 10 ++--- Makefile | 11 ++++++ Tupfile | 8 ++++ Tupfile.ini | 0 build/tup.config | 0 css/Tupfile | 1 + images/Tupfile | 1 + index.md | 2 +- projects/dawnchaos/Tupfile | 8 ++++ projects/maestro/Tupfile | 8 ++++ projects/oboy/Tupfile | 8 ++++ projects/trailr/Tupfile | 8 ++++ projects/whereiscar/Tupfile | 8 ++++ templates/Tupfile | 1 + templates/generate_footer.sh | 9 +++++ templates/nav.html | 6 +++ templates/pandoc.html | 72 ++++++++++++++++++++++++++++++++++++ 17 files changed, 154 insertions(+), 7 deletions(-) create mode 100644 Tupfile create mode 100644 Tupfile.ini create mode 100644 build/tup.config create mode 100644 css/Tupfile create mode 100644 images/Tupfile create mode 100644 projects/dawnchaos/Tupfile create mode 100644 projects/maestro/Tupfile create mode 100644 projects/oboy/Tupfile create mode 100644 projects/trailr/Tupfile create mode 100644 projects/whereiscar/Tupfile create mode 100644 templates/Tupfile create mode 100755 templates/generate_footer.sh create mode 100644 templates/nav.html create mode 100644 templates/pandoc.html diff --git a/.gitignore b/.gitignore index 1f5347a..dbf684c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,9 @@ -# Haskell -*.o -*.hi - # Hakyll _cache _site site -# Vim -*.swp +# Tup +/build/* +!/build/tup.config +graph.png diff --git a/Makefile b/Makefile index 720e58d..a96220c 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,14 @@ all: site.hs build: all ./${TARGET} build + +tup: + tup build + +graph: + tup graph . | dot -Tpng > graph.png + +deploy: + rsync --checksum -ave 'ssh -p 4242' \ + build/* fab@ffreling.com:public_html/ffreling.com/public/ + diff --git a/Tupfile b/Tupfile new file mode 100644 index 0000000..2349037 --- /dev/null +++ b/Tupfile @@ -0,0 +1,8 @@ +: foreach *.md | templates/footer.html |> \ + pandoc --from markdown --to html \ + --template=templates/pandoc.html \ + --css css/default.css \ + --include-before-body=templates/nav.html \ + --include-after-body=templates/footer.html \ + %f --output=%o \ + |> %B.html diff --git a/Tupfile.ini b/Tupfile.ini new file mode 100644 index 0000000..e69de29 diff --git a/build/tup.config b/build/tup.config new file mode 100644 index 0000000..e69de29 diff --git a/css/Tupfile b/css/Tupfile new file mode 100644 index 0000000..8320379 --- /dev/null +++ b/css/Tupfile @@ -0,0 +1 @@ +:foreach *.css |> !tup_preserve |> diff --git a/images/Tupfile b/images/Tupfile new file mode 100644 index 0000000..c5fe903 --- /dev/null +++ b/images/Tupfile @@ -0,0 +1 @@ +:foreach *.png *.jpg |> !tup_preserve |> diff --git a/index.md b/index.md index 6b9eca2..db398d3 100644 --- a/index.md +++ b/index.md @@ -8,7 +8,7 @@ For an up-to-date professional resume, you might want to head over to my [Linked
-Mantis shrimp, minding its own business +Mantis shrimp, minding its own business
May the mighty mantis shrimp smile upon you. diff --git a/projects/dawnchaos/Tupfile b/projects/dawnchaos/Tupfile new file mode 100644 index 0000000..84beffe --- /dev/null +++ b/projects/dawnchaos/Tupfile @@ -0,0 +1,8 @@ +: foreach *.md | ../../templates/footer.html |> \ + pandoc --from markdown --to html \ + --template=../../templates/pandoc.html \ + --css ../../css/default.css \ + --include-before-body=../../templates/nav.html \ + --include-after-body=../../templates/footer.html \ + %f --output=%o \ + |> %B.html diff --git a/projects/maestro/Tupfile b/projects/maestro/Tupfile new file mode 100644 index 0000000..84beffe --- /dev/null +++ b/projects/maestro/Tupfile @@ -0,0 +1,8 @@ +: foreach *.md | ../../templates/footer.html |> \ + pandoc --from markdown --to html \ + --template=../../templates/pandoc.html \ + --css ../../css/default.css \ + --include-before-body=../../templates/nav.html \ + --include-after-body=../../templates/footer.html \ + %f --output=%o \ + |> %B.html diff --git a/projects/oboy/Tupfile b/projects/oboy/Tupfile new file mode 100644 index 0000000..84beffe --- /dev/null +++ b/projects/oboy/Tupfile @@ -0,0 +1,8 @@ +: foreach *.md | ../../templates/footer.html |> \ + pandoc --from markdown --to html \ + --template=../../templates/pandoc.html \ + --css ../../css/default.css \ + --include-before-body=../../templates/nav.html \ + --include-after-body=../../templates/footer.html \ + %f --output=%o \ + |> %B.html diff --git a/projects/trailr/Tupfile b/projects/trailr/Tupfile new file mode 100644 index 0000000..84beffe --- /dev/null +++ b/projects/trailr/Tupfile @@ -0,0 +1,8 @@ +: foreach *.md | ../../templates/footer.html |> \ + pandoc --from markdown --to html \ + --template=../../templates/pandoc.html \ + --css ../../css/default.css \ + --include-before-body=../../templates/nav.html \ + --include-after-body=../../templates/footer.html \ + %f --output=%o \ + |> %B.html diff --git a/projects/whereiscar/Tupfile b/projects/whereiscar/Tupfile new file mode 100644 index 0000000..84beffe --- /dev/null +++ b/projects/whereiscar/Tupfile @@ -0,0 +1,8 @@ +: foreach *.md | ../../templates/footer.html |> \ + pandoc --from markdown --to html \ + --template=../../templates/pandoc.html \ + --css ../../css/default.css \ + --include-before-body=../../templates/nav.html \ + --include-after-body=../../templates/footer.html \ + %f --output=%o \ + |> %B.html diff --git a/templates/Tupfile b/templates/Tupfile new file mode 100644 index 0000000..45e0fb0 --- /dev/null +++ b/templates/Tupfile @@ -0,0 +1 @@ +: |> ./generate_footer.sh > %o |> footer.html diff --git a/templates/generate_footer.sh b/templates/generate_footer.sh new file mode 100755 index 0000000..54df8f5 --- /dev/null +++ b/templates/generate_footer.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cat << EOF + +EOF diff --git a/templates/nav.html b/templates/nav.html new file mode 100644 index 0000000..483c158 --- /dev/null +++ b/templates/nav.html @@ -0,0 +1,6 @@ + + diff --git a/templates/pandoc.html b/templates/pandoc.html new file mode 100644 index 0000000..9816fcf --- /dev/null +++ b/templates/pandoc.html @@ -0,0 +1,72 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ + +