From ed656af469e7a5b3aa7c1c28e195c9d7b9c7e4a9 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Wed, 19 Jun 2019 13:58:22 +0200 Subject: [PATCH] Promote mantis as article --- Tuprules.tup | 11 ++++++ articles/Tupfile | 4 ++ articles/index.md | 7 ++++ mantis.md => articles/mantis.md | 1 + templates/article.html | 69 +++++++++++++++++++++++++++++++++ templates/nav.html | 1 + 6 files changed, 93 insertions(+) create mode 100644 articles/Tupfile create mode 100644 articles/index.md rename mantis.md => articles/mantis.md (99%) create mode 100644 templates/article.html diff --git a/Tuprules.tup b/Tuprules.tup index cdfe965..85eac9c 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -21,3 +21,14 @@ --include-after-body=&(root)/templates/footer.html \ %f | sed 's|%%webRoot%%|&(root)|g' > %o \ |> %B.html + +!article = | &(root)/templates/footer.html \ + |> ^ pandoc %f^ \ + pandoc --from markdown --to html \ + --template=&(root)/templates/article.html \ + --css &(root)/css/style.css \ + --include-in-header=&(root)/templates/header.html \ + --include-before-body=&(root)/templates/nav.html \ + --include-after-body=&(root)/templates/footer.html \ + %f | sed 's|%%webRoot%%|&(root)|g' > %o \ + |> %B.html diff --git a/articles/Tupfile b/articles/Tupfile new file mode 100644 index 0000000..780e2ae --- /dev/null +++ b/articles/Tupfile @@ -0,0 +1,4 @@ +include_rules + +# TODO: autogenerate +: foreach *.md |> !article |> diff --git a/articles/index.md b/articles/index.md new file mode 100644 index 0000000..03872df --- /dev/null +++ b/articles/index.md @@ -0,0 +1,7 @@ +--- +title: Articles +--- + + diff --git a/mantis.md b/articles/mantis.md similarity index 99% rename from mantis.md rename to articles/mantis.md index e50ed9c..e7a30e7 100644 --- a/mantis.md +++ b/articles/mantis.md @@ -1,5 +1,6 @@ --- title: Mantis Shrimp +date: 2011-08-09 --- ## All glory to the mantis shrimp diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..e9022db --- /dev/null +++ b/templates/article.html @@ -0,0 +1,69 @@ + + + + + + +$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$ + + diff --git a/templates/nav.html b/templates/nav.html index b22d549..ca41a64 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -2,5 +2,6 @@