Use webRoot for relative links

This commit is contained in:
Fabien Freling 2019-06-14 13:53:29 +02:00
parent 8fcf435b17
commit a2c8fb9dd4
12 changed files with 23 additions and 25 deletions

View file

@ -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/

View file

@ -1,3 +1,4 @@
include_rules
: foreach *.md |> !pandoc |>
: favicon.png |> !tup_preserve |>

View file

@ -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

View file

@ -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

View file

@ -1,2 +1,3 @@
include_rules
: foreach *.md |> !pandoc |>

View file

@ -1,2 +1,3 @@
include_rules
: foreach *.md |> !pandoc |>

View file

@ -1,2 +1,3 @@
include_rules
: foreach *.md |> !pandoc |>

View file

@ -1,2 +1,3 @@
include_rules
: foreach *.md |> !pandoc |>

View file

@ -1,2 +1,3 @@
include_rules
: foreach *.md |> !pandoc |>

View file

@ -1 +1 @@
<link rel="icon" type="image/png" href="favicon.png">
<link rel="icon" type="image/png" href="%webRoot%/favicon.png">

View file

@ -1,6 +1,6 @@
<div id="banner"></div>
<div id="navigation">
<a href="index.html">Home</a>
<a href="projects.html">Projects</a>
<a href="about.html">About</a>
<a href="%webRoot%/index.html">Home</a>
<a href="%webRoot%/projects.html">Projects</a>
<a href="%webRoot%/about.html">About</a>
</div>

View file

@ -34,9 +34,6 @@ $endfor$
$if(math)$
$math$
$endif$
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
$for(header-includes)$
$header-includes$
$endfor$
@ -45,14 +42,6 @@ $endfor$
$for(include-before)$
$include-before$
$endfor$
<div id="banner"></div>
<div id="navigation">
<a href=$webRoot$/index.html>Home</a>
<a href=$webRoot$/projects.html>Projects</a>
<a href=$webRoot$/about.html>About</a>
</div>
$if(title)$
<header id="title-block-header">
<h1 class="title">$title$</h1>