diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-05-22 12:13:41 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-05-22 12:13:41 +0200 |
| commit | 2930632c5e0a53eeda24aaaf66bc3c2aab758dba (patch) | |
| tree | 434dc6b80971fd3264660ba0f162e31480852180 /build.sh | |
| parent | 407aa6fbdbddc1650aa9b44de87af4377fa516ea (diff) | |
| download | sebastiano.tronto.net-2930632c5e0a53eeda24aaaf66bc3c2aab758dba.tar.gz sebastiano.tronto.net-2930632c5e0a53eeda24aaaf66bc3c2aab758dba.zip | |
Added build for gemini; changed logo to img
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 12 |
1 files changed, 12 insertions, 0 deletions
| @@ -2,10 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | recursivebuild() { | 3 | recursivebuild() { |
| 4 | local destdir=$(echo $1 | sed 's|^src|http|') | 4 | local destdir=$(echo $1 | sed 's|^src|http|') |
| 5 | local destdir_gmi=$(echo $1 | sed 's|^src|gemini|') | ||
| 5 | mkdir -p "$destdir" | 6 | mkdir -p "$destdir" |
| 7 | mkdir -p "$destdir_gmi" | ||
| 6 | for file in $(ls $1); do | 8 | for file in $(ls $1); do |
| 7 | if [ -d "$1/$file" ]; then | 9 | if [ -d "$1/$file" ]; then |
| 8 | mkdir -p "$destdir/$file" | 10 | mkdir -p "$destdir/$file" |
| 11 | mkdir -p "$destdir_gmi/$file" | ||
| 9 | recursivebuild "$1/$file" | 12 | recursivebuild "$1/$file" |
| 10 | else | 13 | else |
| 11 | extension=$(echo "$file" | sed 's/.*\.//') | 14 | extension=$(echo "$file" | sed 's/.*\.//') |
| @@ -15,6 +18,11 @@ recursivebuild() { | |||
| 15 | > "$destdir/index.html" | 18 | > "$destdir/index.html" |
| 16 | lowdown "$1/$file" >> "$destdir/index.html" | 19 | lowdown "$1/$file" >> "$destdir/index.html" |
| 17 | cat bottom.html >> "$destdir/index.html" | 20 | cat bottom.html >> "$destdir/index.html" |
| 21 | |||
| 22 | lowdown -Tgemini --gemini-link-roman \ | ||
| 23 | --gemini-link-end \ | ||
| 24 | "$1/$file" > "$destdir_gmi/index.gmi" | ||
| 25 | cat bottom.gmi >> "$destdir_gmi/index.gmi" | ||
| 18 | elif [ "$extension" = "html" ]; then | 26 | elif [ "$extension" = "html" ]; then |
| 19 | cat top.html "$1/$file" bottom.html \ | 27 | cat top.html "$1/$file" bottom.html \ |
| 20 | | sed "s/TITLE/$(grep '<!--TITLE: ' <\ | 28 | | sed "s/TITLE/$(grep '<!--TITLE: ' <\ |
| @@ -22,8 +30,12 @@ recursivebuild() { | |||
| 22 | | sed 's/^<!--TITLE: //' \ | 30 | | sed 's/^<!--TITLE: //' \ |
| 23 | | sed 's/-->$//')/" \ | 31 | | sed 's/-->$//')/" \ |
| 24 | > "$destdir/index.html" | 32 | > "$destdir/index.html" |
| 33 | elif [ "$extension" = "gmi" ]; then | ||
| 34 | cat "$1/$file" bottom.gmi > \ | ||
| 35 | "$destdir_gmi/index.gmi" | ||
| 25 | else | 36 | else |
| 26 | cp "$1/$file" "$destdir/$file" | 37 | cp "$1/$file" "$destdir/$file" |
| 38 | cp "$1/$file" "$destdir_gmi/$file" | ||
| 27 | fi | 39 | fi |
| 28 | fi | 40 | fi |
| 29 | done | 41 | done |
