depsterr.com

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

commit 982d8173419e0ba621e55129f4d921571df83044
parent 329badbed39629f603e27fcf37af37337f51d247
Author: depsterr <depsterr@protonmail.com>
Date:   Thu, 25 Jun 2020 22:31:07 +0200

updated scripts

Diffstat:
Agit_pages.sh | 20++++++++++++++++++++
Mmake_pages.sh | 14+++++++-------
2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/git_pages.sh b/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 "$(find "$DESTDIR" -not -name "$DESTDIR" -and -not -path "*/git/*")" +rm -rf "$(find "$DESTDIR" -not -name "$DESTDIR" -not -path "*/git*")" # generate pages for file in "$SRCDIR"/*.md; do @@ -27,19 +27,19 @@ find "$SRCDIR" -type d -not -name "$SRCDIR" | while read -r dir; do mkdir -p "$(echo "$dir" | sed "s/$SRCDIR/$DESTDIR/g")" done -# generate blog pages +# generate sub pages 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 - file="$(basename "${file%.md}.html")" - inner="${inner}<li><a href=\"$file\">${file%.html}</a></li>" - done for cdir in "$dir"/*/; do [ -d "$cdir" ] || continue cdir="$(basename "$cdir")/" inner="${inner}<li><a href=\"$cdir\">$cdir</a></li>" done + for file in "$dir"/*.md; do + [ -f "$file" ] || continue + file="$(basename "${file%.md}.html")" + inner="${inner}<li><a href=\"$file\">${file%.html}</a></li>" + done [ -z "$inner" ] && sidebar="" || sidebar="<aside id=\"sidebar\"><ul>${inner}</ul></aside>" find "$dir" -type f -name '*.md' | while read -r file; do destination="$(echo "$file" | sed -e "s/$SRCDIR/$DESTDIR/g" -e 's/\.md/\.html/g')"