depsterr.com

The sources and build system for depsterr.com
git clone git://depsterr.com/git/depsterr.com
Log | Files | Refs | LICENSE

commit 329badbed39629f603e27fcf37af37337f51d247
parent 1d321b2cc403a35823ebbe229fe58542abd72845
Author: depsterr <depsterr@protonmail.com>
Date:   Thu, 25 Jun 2020 22:12:37 +0200

updated scripts to be compatible with each other

Diffstat:
Amake_git_pages.sh | 20++++++++++++++++++++
Mmake_pages.sh | 6+++---
2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/make_git_pages.sh b/make_git_pages.sh @@ -0,0 +1,20 @@ +cd "$(dirname "$0")" || exit + +DESTDIR=doc +SRCDIR=src + +# generate git pages +find "$SRCDIR" -type d -name "git" | while read -r dir; do + destdir="$(echo "$dir" | sed -e "s/$SRCDIR/$DESTDIR/g")" + is_empty=true + for repo in "$dir"/*/; do + [ -d "$repo" ] || continue + is_empty=false + mkdir -p "$destdir/$repo" + fullrepo="$PWD/$repo" + (cd "$destdir/$(basename "$repo")" && stagit "$fullrepo") + done + [ "$is_empty" = false ] && stagit-index "$dir"/*/ > "$destdir/index.html" +done + + diff --git a/make_pages.sh b/make_pages.sh @@ -13,7 +13,7 @@ MD=smu # clean old docs mkdir -p "$DESTDIR" -rm -rf "${DESTDIR:?}"/* +rm -rf "$(find "$DESTDIR" -not -name "$DESTDIR" -and -not -path "*/git/*")" # generate pages for file in "$SRCDIR"/*.md; do @@ -28,7 +28,7 @@ find "$SRCDIR" -type d -not -name "$SRCDIR" | while read -r dir; do done # generate blog pages -find "$SRCDIR" -type d -not -name "$SRCDIR" -and -not -name "git" | while read -r dir; do +find "$SRCDIR" -type d -not -name "$SRCDIR" -and -not -path "*/git/*" | while read -r dir; do inner="" for file in "$SRCDIR"/*.md; do [ -f "$file" ] || continue @@ -51,7 +51,7 @@ EOF done # generate index pages -find "$DESTDIR" -type d -not -name "$SRCDIR" | while read -r dir; do +find "$DESTDIR" -type d -not -name "$SRCDIR" -and -not -path "*/git/*" | while read -r dir; do [ -f "$dir/index.html" ] && continue inner="" for cdir in "$dir"/*/; do