From 742cbe8870d3258f07eedc933987c883591d0625 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 1 Jun 2022 23:19:37 -0300 Subject: src/development/genhtml.sh: Use relative URLs by default, with BASE_URL=/ --- src/development/config.env | 2 +- src/development/genhtml.sh | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/development/config.env b/src/development/config.env index 69466be..9da0910 100644 --- a/src/development/config.env +++ b/src/development/config.env @@ -1,5 +1,5 @@ #!/bin/sh FQDN='euandre.org' -BASE_URL='' # '/subfolder' +BASE_URL='/' # '/subfolder' lang=en diff --git a/src/development/genhtml.sh b/src/development/genhtml.sh index 34588ef..7baacf5 100755 --- a/src/development/genhtml.sh +++ b/src/development/genhtml.sh @@ -8,7 +8,11 @@ escape() { } url_for() { - printf 'https://%s%s%s' "$FQDN" "$BASE_URL" "$1" + printf '%s%s' "$BASE_URL" "$1" +} + +absolute() { + printf 'https://%s%s' "$FQDN" "$(cat)" } _() { @@ -27,8 +31,8 @@ cat <<-EOF - - + + @@ -41,16 +45,16 @@ cat <<-EOF - - + +