Refactor tupfiles
This commit is contained in:
parent
eab3405456
commit
4beeae10ab
2
Tupfile
2
Tupfile
|
@ -1,4 +1,4 @@
|
|||
include_rules
|
||||
|
||||
: foreach *.md |> !pandoc |>
|
||||
: foreach *.md |> !html |>
|
||||
: favicon.png |> !tup_preserve |>
|
||||
|
|
28
Tuprules.tup
28
Tuprules.tup
|
@ -1,31 +1,11 @@
|
|||
&root = .
|
||||
|
||||
!pandoc = | &(root)/templates/footer.html \
|
||||
|> ^ pandoc %f^ \
|
||||
pandoc --from markdown --to html \
|
||||
--template=&(root)/templates/pandoc.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
|
||||
HTML_TEMPLATE = main.html
|
||||
|
||||
!project = | &(root)/templates/footer.html \
|
||||
|> ^ pandoc %f^ \
|
||||
!html = | &(root)/templates/footer.html \
|
||||
|> ^ html %f^ \
|
||||
pandoc --from markdown --to html \
|
||||
--template=&(root)/templates/project.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
|
||||
|
||||
!article = | &(root)/templates/footer.html \
|
||||
|> ^ pandoc %f^ \
|
||||
pandoc --from markdown --to html \
|
||||
--template=&(root)/templates/article.html \
|
||||
--template=&(root)/templates/$(HTML_TEMPLATE) \
|
||||
--css &(root)/css/style.css \
|
||||
--include-in-header=&(root)/templates/header.html \
|
||||
--include-before-body=&(root)/templates/nav.html \
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
include_rules
|
||||
HTML_TEMPLATE = article.html
|
||||
|
||||
: |> ./generate_listing.sh > %o |> index.md
|
||||
: foreach *.md |> !article |>
|
||||
: *.md |> ./generate_listing.sh > %o |> index.md
|
||||
: foreach *.md |> !html |>
|
||||
|
|
1
projects/Tuprules.tup
Normal file
1
projects/Tuprules.tup
Normal file
|
@ -0,0 +1 @@
|
|||
HTML_TEMPLATE = project.html
|
|
@ -1,4 +1,4 @@
|
|||
include_rules
|
||||
|
||||
: index.md |> !project |>
|
||||
: index.md |> !html |>
|
||||
: thumbnail.png |> convert %f -blur 0x8 %o |> thumb.png
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
include_rules
|
||||
|
||||
: index.md |> !project |>
|
||||
: index.md |> !html |>
|
||||
: thumbnail.png |> convert %f -blur 0x8 %o |> thumb.png
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
include_rules
|
||||
|
||||
: index.md |> !project |>
|
||||
: index.md |> !html |>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
include_rules
|
||||
|
||||
: index.md |> !project |>
|
||||
: index.md |> !html |>
|
||||
: thumbnail.gif |> convert %f -blur 0x8 %o |> thumb.gif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
include_rules
|
||||
|
||||
: index.md |> !project |>
|
||||
: index.md |> !html |>
|
||||
: thumbnail.jpg |> convert %f -blur 0x8 %o |> thumb.jpg
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
include_rules
|
||||
|
||||
: index.md |> !project |>
|
||||
: index.md |> !html |>
|
||||
: thumbnail.png |> convert %f -blur 0x8 %o |> thumb.png
|
||||
|
|
55
templates/main.html
Normal file
55
templates/main.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
$for(author-meta)$
|
||||
<meta name="author" content="$author-meta$" />
|
||||
$endfor$
|
||||
$if(date-meta)$
|
||||
<meta name="dcterms.date" content="$date-meta$" />
|
||||
$endif$
|
||||
$if(keywords)$
|
||||
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
|
||||
$endif$
|
||||
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
|
||||
$for(css)$
|
||||
<link rel="stylesheet" href="$css$" />
|
||||
$endfor$
|
||||
$if(math)$
|
||||
$math$
|
||||
$endif$
|
||||
$for(header-includes)$
|
||||
$header-includes$
|
||||
$endfor$
|
||||
</head>
|
||||
<body>
|
||||
$for(include-before)$
|
||||
$include-before$
|
||||
$endfor$
|
||||
$if(title)$
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">$title$</h1>
|
||||
$if(subtitle)$
|
||||
<p class="subtitle">$subtitle$</p>
|
||||
$endif$
|
||||
$for(author)$
|
||||
<p class="author">$author$</p>
|
||||
$endfor$
|
||||
$if(date)$
|
||||
<p class="date">$date$</p>
|
||||
$endif$
|
||||
</header>
|
||||
$endif$
|
||||
$if(toc)$
|
||||
<nav id="$idprefix$TOC" role="doc-toc">
|
||||
$table-of-contents$
|
||||
</nav>
|
||||
$endif$
|
||||
$body$
|
||||
$for(include-after)$
|
||||
$include-after$
|
||||
$endfor$
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue