depsterr.com

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

commit 75babe04935278159e9bfa7e9a90620ec776ee79
parent a0084668796a3954f881732bb6cd73f36dd2ffd7
Author: depsterr <depsterr@protonmail.com>
Date:   Thu, 25 Jun 2020 23:22:21 +0200

changed to git page from creating a page

Diffstat:
Agit_page.sh | 47+++++++++++++++++++++++++++++++++++++++++++++++
Dgit_pages.sh | 20--------------------
Mmake_pages.sh | 19+++++++++++++++++++
Dsrc/git/depsterr.com | 2--
4 files changed, 66 insertions(+), 22 deletions(-)

diff --git a/git_page.sh b/git_page.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# https://github.com/dylanaraps/pure-sh-bible +basename() { + dir=${1%${1##*[!/]}} + dir=${dir##*/} + dir=${dir%"$2"} + printf '%s\n' "${dir:-/}" +} + +# https://github.com/dylanaraps/pure-sh-bible +dirname() { + dir=${1:-.} + dir=${dir%%"${dir##*[!/]}"} + [ "${dir##*/*}" ] && dir=. + dir=${dir%/*} + dir=${dir%%"${dir##*[!/]}"} + printf '%s\n' "${dir:-/}" +} + +cd "$(dirname "$0")" || exit + +echo $0 | grep -q '*.git' && { + echo "cannot use a repo that ends in git" + exit 1 +} + +# $1 = full path to repo + +DESTDIR="doc/git/$(basename "$0")" + +mkdir -p "$DESTDIR" +(cd "$DESTDIR" && stagit "$0") + +cat > "$DESTDIR/style.css" <<-EOF +body{background:#2e2e2e;} +*{font-family: monospace;} +#title{font-size:2.5em;} +h1,h2,h3,h4,h6{color:#e88be0;} +hr{border-color:#1DDBC9;} +p,tr,td{color:#f5f5f5;} +a,a:link,a:visited,a:active{color: #1ddbc9;} +a:hover{color:#f7bf65;} +.desc{display:none;} +EOF + +stagit-index "$DESTDIR"/*/ diff --git a/git_pages.sh b/git_pages.sh @@ -1,20 +0,0 @@ -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 @@ -1,4 +1,23 @@ #! /bin/sh + +# https://github.com/dylanaraps/pure-sh-bible +basename() { + dir=${1%${1##*[!/]}} + dir=${dir##*/} + dir=${dir%"$2"} + printf '%s\n' "${dir:-/}" +} + +# https://github.com/dylanaraps/pure-sh-bible +dirname() { + dir=${1:-.} + dir=${dir%%"${dir##*[!/]}"} + [ "${dir##*/*}" ] && dir=. + dir=${dir%/*} + dir=${dir%%"${dir##*[!/]}"} + printf '%s\n' "${dir:-/}" +} + cd "$(dirname "$0")" || exit DESTDIR=doc diff --git a/src/git/depsterr.com b/src/git/depsterr.com @@ -1 +0,0 @@ -/home/deppy/proj/web/depsterr.com/.git- \ No newline at end of file