From a2c8fb9dd42fb86ae64dc69a6e77d562ad154607 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 14 Jun 2019 13:53:29 +0200 Subject: [PATCH] Use webRoot for relative links --- Makefile | 10 +++++----- Tupfile | 1 + Tuprules.tup | 9 ++++++--- images/Tupfile | 4 ++-- projects/dawnchaos/Tupfile | 1 + projects/maestro/Tupfile | 1 + projects/oboy/Tupfile | 1 + projects/trailr/Tupfile | 1 + projects/whereiscar/Tupfile | 1 + templates/header.html | 2 +- templates/nav.html | 6 +++--- templates/pandoc.html | 11 ----------- 12 files changed, 23 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index ba15569..e0f9244 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,6 @@ all: tup tup: tup build -preview: tup - rm -rf preview - cp -r build preview - rm -f preview/tup.config - clean: git nuke @@ -18,3 +13,8 @@ deploy: clean tup rsync --checksum --copy-links -ave 'ssh -p 4242' \ --exclude-from=rsync_excludes.txt \ build/* fab@ffreling.com:public_html/ffreling.com/public/ + +preview: tup + rsync --checksum --copy-links -ave 'ssh -p 4242' \ + --exclude-from=rsync_excludes.txt \ + build/* preview/ diff --git a/Tupfile b/Tupfile index 4ec31aa..ae9d358 100644 --- a/Tupfile +++ b/Tupfile @@ -1,3 +1,4 @@ include_rules + : foreach *.md |> !pandoc |> : favicon.png |> !tup_preserve |> diff --git a/Tuprules.tup b/Tuprules.tup index 5e1e110..8e0f7b0 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -1,9 +1,12 @@ &root = . -!pandoc = | &(root)/templates/footer.html |> pandoc --from markdown --to html \ + +!pandoc = | &(root)/templates/footer.html \ + |> ^ pandoc %f^ \ + pandoc --from markdown --to html \ --template=&(root)/templates/pandoc.html \ - --variable=webRoot:&(root) \ --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 --output=%o \ + %f | sed 's|%%webRoot%%|&(root)|g' > %o \ |> %B.html diff --git a/images/Tupfile b/images/Tupfile index c51a125..0cf8d3a 100644 --- a/images/Tupfile +++ b/images/Tupfile @@ -2,11 +2,11 @@ fabien.jpg \ fabien_zenly.jpg \ mantis_shrimp.png \ - |> cwebp -q 80 %f -o %o |> %B.webp + |> ^ WebP conversion %f^ cwebp -q 80 -quiet %f -o %o |> %B.webp : foreach \ github_logo.png \ gitlab_logo.png \ leencktyn_logo.png \ mastodon.jpg \ - |> cwebp -q 80 -resize 0 40 %f -o %o |> %B_40.webp + |> ^ WebP conversion %f^ cwebp -q 80 -quiet -resize 0 40 %f -o %o |> %B_40.webp diff --git a/projects/dawnchaos/Tupfile b/projects/dawnchaos/Tupfile index 1afc377..18c0f16 100644 --- a/projects/dawnchaos/Tupfile +++ b/projects/dawnchaos/Tupfile @@ -1,2 +1,3 @@ include_rules + : foreach *.md |> !pandoc |> diff --git a/projects/maestro/Tupfile b/projects/maestro/Tupfile index 1afc377..18c0f16 100644 --- a/projects/maestro/Tupfile +++ b/projects/maestro/Tupfile @@ -1,2 +1,3 @@ include_rules + : foreach *.md |> !pandoc |> diff --git a/projects/oboy/Tupfile b/projects/oboy/Tupfile index 1afc377..18c0f16 100644 --- a/projects/oboy/Tupfile +++ b/projects/oboy/Tupfile @@ -1,2 +1,3 @@ include_rules + : foreach *.md |> !pandoc |> diff --git a/projects/trailr/Tupfile b/projects/trailr/Tupfile index 1afc377..18c0f16 100644 --- a/projects/trailr/Tupfile +++ b/projects/trailr/Tupfile @@ -1,2 +1,3 @@ include_rules + : foreach *.md |> !pandoc |> diff --git a/projects/whereiscar/Tupfile b/projects/whereiscar/Tupfile index 1afc377..18c0f16 100644 --- a/projects/whereiscar/Tupfile +++ b/projects/whereiscar/Tupfile @@ -1,2 +1,3 @@ include_rules + : foreach *.md |> !pandoc |> diff --git a/templates/header.html b/templates/header.html index f99c190..b7af5e2 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1 +1 @@ - + diff --git a/templates/nav.html b/templates/nav.html index 483c158..b22d549 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,6 +1,6 @@ diff --git a/templates/pandoc.html b/templates/pandoc.html index 1dc9267..e9022db 100644 --- a/templates/pandoc.html +++ b/templates/pandoc.html @@ -34,9 +34,6 @@ $endfor$ $if(math)$ $math$ $endif$ - $for(header-includes)$ $header-includes$ $endfor$ @@ -45,14 +42,6 @@ $endfor$ $for(include-before)$ $include-before$ $endfor$ - - - - $if(title)$

$title$