From f3b89d42e03a14385d1e32b7aa8450a2698ec076 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 7 Jun 2024 21:24:47 +0100 Subject: Feat: support for website and notebook --- bin/archive | 10 ++++++++-- bin/assemble | 33 +++++++++++++++++++++++++++++++++ bin/provision-host | 8 ++++---- 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100755 bin/assemble (limited to 'bin') diff --git a/bin/archive b/bin/archive index 27728e4..584ea13 100755 --- a/bin/archive +++ b/bin/archive @@ -10,8 +10,14 @@ BASEDIR="$DIRNAME/.." #ARCHIVE="$BASEDIR/archive" ARCHIVE="archive" REVISION="`git describe --tags 2> /dev/null || git log -1 --format=oneline | cut -d ' ' -f 1`" -#REVFILE="$BASEDIR/compiled/revision" -REVFILE="compiled/revision" + +# Determine the revision file +if [ -e "public/revision" ]; then + #REVFILE="$BASEDIR/public/revision" + REVFILE="public/revision" +else + REVFILE="public/book/revision" +fi # Make sure the archive folder exist mkdir -p $ARCHIVE diff --git a/bin/assemble b/bin/assemble new file mode 100755 index 0000000..cd0836c --- /dev/null +++ b/bin/assemble @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Assembler +# + +# Parameters +BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`" +DIRNAME="`dirname $0`" +BASEDIR="$DIRNAME/.." +SITE="site" +NOTEBOOK="notebook" +PUBLIC="public" + +# Cleanup the previous public folder +rm -rf $PUBLIC + +# Check if there's a site folder +if [ -e "$SITE" ]; then + cp -a $SITE public + + if [ -e "compiled" ]; then + mv compiled public/book + fi +else + if [ -e "compiled" ]; then + mv compiled public + fi +fi + +# Check if there's a notebook +if [ -e "$NOTEBOOK" ]; then + mv $NOTEBOOK public/notes +fi diff --git a/bin/provision-host b/bin/provision-host index 16712fb..13b8a78 100755 --- a/bin/provision-host +++ b/bin/provision-host @@ -44,9 +44,9 @@ cat <<-EOF | $SUDO tee /etc/apache2/sites-available/onion.conf > /dev/null ServerName localhost ServerAlias *.onion - DocumentRoot "/srv/shared/compiled" + DocumentRoot "/srv/shared/public" - + #AuthType Basic #AuthName "Protected" #AuthUserFile /srv/shared/.htpasswd @@ -62,9 +62,9 @@ EOF cat <<-EOF | $SUDO tee /etc/apache2/sites-available/local.conf > /dev/null ServerName ${PROJECT}.local - DocumentRoot "/srv/shared/compiled" + DocumentRoot "/srv/shared/public" - + #AuthType Basic #AuthName "Protected" #AuthUserFile /srv/shared/.htpasswd -- cgit v1.2.3