commit 58dd2fe18f84ef31f0cbcf802aae7b847ce3fb96 parent bf682081d245f389fc5712c6911746c03241ec20 Author: Wim Dupont <wim@wimdupont.com> Date: Sun, 15 Jun 2025 19:42:12 +0200 reorganize files Diffstat:
12 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/generate.sh b/generate.sh @@ -1,5 +1,7 @@ #!/bin/bash +shopt -s extglob + readonly NGINX_DIR=/usr/share/nginx/html readonly BLOG_DEST_DIR=$NGINX_DIR/blog readonly GUIDES_DEST_DIR=$NGINX_DIR/guides @@ -8,15 +10,15 @@ readonly RSS_DEST_FILE=$NGINX_DIR/rss.xml readonly REPO_PATH=$(echo "$(dirname -- "$(readlink -f "${BASH_SOURCE}")")") readonly PAGES_REPO_DIR=$REPO_PATH/pages -readonly BLOG_REPO_DIR=$PAGES_REPO_DIR/blog -readonly GUIDE_REPO_DIR=$PAGES_REPO_DIR/guides -readonly SOFTWARE_REPO_DIR=$PAGES_REPO_DIR/software -readonly ERROR_REPO_DIR=$PAGES_REPO_DIR/error readonly HREF_REPO_DIR=$PAGES_REPO_DIR/href +readonly BLOG_REPO_DIR=$HREF_REPO_DIR/blog +readonly GUIDE_REPO_DIR=$HREF_REPO_DIR/guides +readonly SOFTWARE_REPO_DIR=$HREF_REPO_DIR/software +readonly ERROR_REPO_DIR=$PAGES_REPO_DIR/error readonly BOOKLIST_FILE=$REPO_PATH/content/booklist.csv readonly LINKS_FILE=$REPO_PATH/content/links.csv -readonly HEADER_FILE=$PAGES_REPO_DIR/header/header.adoc -readonly FOOTER_FILE=$PAGES_REPO_DIR/footer/footer.adoc +readonly HEADER_FILE=$PAGES_REPO_DIR/header.adoc +readonly FOOTER_FILE=$PAGES_REPO_DIR/footer.adoc rm -rf $NGINX_DIR/* @@ -46,12 +48,12 @@ get_page_footer() { } generate_pages() { - repo_path=$1 - dest_path=$2 - root_nav=$3 - sub_title=$4 + local repo_path=$1 + local dest_path=$2 + local root_nav=$3 + local sub_title=$4 - for file in $repo_path/* ; do + for file in $repo_path/!(header.adoc|footer.adoc) ; do if [[ -f $file ]]; then cd ${repo_path} date=$(git log -1 --pretty="format:%ci" "$file") @@ -72,18 +74,18 @@ generate_pages() { } as_href() { - dir_ref=$1 - filename=$2 - date=$3 - filelink=$(echo "$filename" | sed 's/ /%20/g') + local dir_ref=$1 + local filename=$2 + local date=$3 + local filelink=$(echo "$filename" | sed 's/ /%20/g') echo -n "link:$dir_ref/$filelink[$filename]" && test -n "$date" && echo -n " _- ${date}_" } generate_href_page() { - name=$1 - ref_dir=$2 - with_date=$3 + local name=$1 + local ref_dir=$2 + local with_date=$3 cd $ref_dir get_page_header "${name}" > "$NGINX_DIR/$name.adoc" diff --git a/pages/footer/footer.adoc b/pages/footer.adoc diff --git a/pages/header/header.adoc b/pages/header.adoc diff --git a/pages/blog/And so it begins.adoc b/pages/href/blog/And so it begins.adoc diff --git a/pages/blog/Genesis.adoc b/pages/href/blog/Genesis.adoc diff --git a/pages/blog/Knowledge, ignorance, and ego.adoc b/pages/href/blog/Knowledge, ignorance, and ego.adoc diff --git a/pages/blog/Make RSS great again.adoc b/pages/href/blog/Make RSS great again.adoc diff --git a/pages/blog/Stick to your goals and beliefs.adoc b/pages/href/blog/Stick to your goals and beliefs.adoc diff --git a/pages/blog/Worries and independence.adoc b/pages/href/blog/Worries and independence.adoc diff --git a/pages/guides/Arch Linux encrypted installation.adoc b/pages/href/guides/Arch Linux encrypted installation.adoc diff --git a/pages/software/cex.adoc b/pages/href/software/cex.adoc diff --git a/pages/software/scal.adoc b/pages/href/software/scal.adoc