wimdupont.com

Code generator of https://wimdupont.com
git clone git://git.wimdupont.com/wimdupont.com.git
Log | Files | Refs | README | LICENSE

commit da61e75d18489b728e507f45f0df3273ed251ddb
parent 54deeb7702557a443fe4fd850800b5fe4a22d270
Author: Wim Dupont <wim@wimdupont.com>
Date:   Fri, 26 Apr 2024 17:04:32 +0200

restyling

Diffstat:
Mcontent/links.csv | 24++++++++++++------------
Mgenerate.sh | 47+++++++++++++++++++++++++++++++----------------
Mimages/git.png | 0
Mimages/rssfeed.png | 0
Mmain.css | 90++++++++++++++++++++++++++-----------------------------------------------------
Mpages/donate.adoc | 4++--
Mpages/error/50x.adoc | 1-
Apages/footer/footer.adoc | 6++++++
Mpages/header/header.adoc | 27++++++++++-----------------
Mpages/home.adoc | 8++++----
10 files changed, 94 insertions(+), 113 deletions(-)

diff --git a/content/links.csv b/content/links.csv @@ -1,13 +1,13 @@ -Git;https://git.wimdupont.com;Git page with source code of this website and other projects;;files/images/git.png -RSS;rss.xml;RSS feed of the blog page;;files/images/rssfeed.png -Electronic Frontier Foundation;https://www.eff.org/; EFF homepage - non-profit digital rights group;Privacy/Digital rights; -Free Software Foundation;https://www.fsf.org/;FSF homepage, great resource to get to know Free/Libre Software and its importance;Privacy/Digital rights; -Privacy Guides;https://privacyguides.org/;useful information about digital privacy including software recommendations and tips;Privacy/Digital rights; -GnuPG;https://gnupg.org/;encryption software suite using the OpenPGP standard;Software; -Invidious;https://invidious.io/;privacy focused open software alternative front-end to YouTube;Software; -Odysee;https://odysee.com/;video-sharing website that uses the decentralized LBRY network;Software; -Password Store;https://www.passwordstore.org/;simple and extensible password manager;Software; -Sfeed;https://git.codemadness.org/sfeed/;Simple CLI RSS/Atom feed reader;Software; -Signal;https://www.signal.org/;encrypted instant messaging service;Software; +Git;https://git.wimdupont.com;Git page with source code of this website and other projects; +RSS;rss.xml;RSS feed of the blog page; +Electronic Frontier Foundation;https://www.eff.org/;EFF homepage - non-profit digital rights group;Privacy/Digital rights +Free Software Foundation;https://www.fsf.org/;FSF homepage, great resource to get to know Free/Libre Software and its importance;Privacy/Digital rights +Privacy Guides;https://privacyguides.org/;useful information about digital privacy including software recommendations and tips;Privacy/Digital rights +GnuPG;https://gnupg.org/;encryption software suite using the OpenPGP standard;Software +Invidious;https://invidious.io/;privacy focused open software alternative front-end to YouTube;Software +Odysee;https://odysee.com/;video-sharing website that uses the decentralized LBRY network;Software +Password Store;https://www.passwordstore.org/;simple and extensible password manager;Software +Sfeed;https://git.codemadness.org/sfeed/;Simple CLI RSS/Atom feed reader;Software +Signal;https://www.signal.org/;encrypted instant messaging service;Software Suckless;https://suckless.org/;software with a focus on simplicity, clarity, and frugality;Software -Vim;https://www.vim.org/;highly customizable and efficient text editor;Software; +Vim;https://www.vim.org/;highly customizable and efficient text editor;Software diff --git a/generate.sh b/generate.sh @@ -13,27 +13,38 @@ 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 rm -rf $NGINX_DIR/* mkdir -p $NGINX_DIR/files +mkdir -p $NGINX_DIR/stylesheets mkdir -p $ARTICLES_DEST_DIR mkdir -p $GUIDE_DEST_DIR cp -rf $REPO_PATH/images "$NGINX_DIR/files" cp $REPO_PATH/pubkey.gpg "$NGINX_DIR/files" -cp $REPO_PATH/main.css $NGINX_DIR +cp $REPO_PATH/main.css $NGINX_DIR/stylesheets get_page_header() { declare -r TITLE="${1^}" declare -r ROOT_NAV=$(echo $2 | sed 's/\//\\\//g') - cat $HEADER_FILE | sed "s/{root_nav}/${ROOT_NAV}/g" | sed "s/{title}/${TITLE}/g" + declare -r SUB_TITLE=$3 + + cat $HEADER_FILE | sed "s/{root_nav}/${ROOT_NAV}/g" | sed "s/{title}/${TITLE}/g" && test "$SUB_TITLE" == 1 && echo -e "[.subheader]\n--\n${TITLE}\n-- " +} + +get_page_footer() { + declare -r ROOT_NAV=$(echo $1 | sed 's/\//\\\//g') + + cat $FOOTER_FILE | sed "s/{root_nav}/${ROOT_NAV}/g" } generate_pages() { repo_path=$1 dest_path=$2 root_nav=$3 + sub_title=$4 for file in $repo_path/* ; do if [[ -f $file ]]; then @@ -42,8 +53,9 @@ generate_pages() { cd ${dest_path} filename=$(basename "${file}" .adoc) - get_page_header "$filename" "$root_nav" >> "$dest_path/$filename.adoc" + get_page_header "$filename" "$root_nav" "$sub_title" >> "$dest_path/$filename.adoc" cat "$file" >> "$dest_path/$filename.adoc" + get_page_footer "$root_nav" >> "$dest_path/$filename.adoc" asciidoctor "$dest_path/$filename.adoc" rm "$dest_path/$filename.adoc" @@ -60,7 +72,7 @@ as_href() { date=$3 filelink=$(echo "$filename" | sed 's/ /%20/g') - echo -n "link:$dir_ref/$filelink[$filename]" && test -n "$date" && echo -n " - $date" + echo -n "link:$dir_ref/$filelink[$filename]" && test -n "$date" && echo -n " _- ${date}_" } generate_href_page() { @@ -70,7 +82,7 @@ generate_href_page() { with_date=$4 cd $ref_dir - get_page_header "${1}" > "$NGINX_DIR/$name.adoc" + get_page_header "${name}" > "$NGINX_DIR/$name.adoc" readarray -t files < <(stat -c '%Y %n' * | sort -n -r) @@ -85,6 +97,7 @@ generate_href_page() { echo "* $art_fileref" >> "$NGINX_DIR/$name.adoc" done cd $NGINX_DIR + get_page_footer "" >> "$NGINX_DIR/$name.adoc" asciidoctor "$name.adoc" rm "$name.adoc" } @@ -116,15 +129,16 @@ generate_books_page() { category_check=$category fi if [[ -z "$series" ]]; then - echo "|link:https://openlibrary.org/isbn/$isbn[$title]|[.align-right]#$author#" >> $DEST_FILE + echo "|link:https://openlibrary.org/isbn/$isbn[$title]|$author" >> $DEST_FILE else series=$(test -z $series_number && echo -n $series || echo -n "$series #$series_number") - echo "|link:https://openlibrary.org/isbn/$isbn[$title] [.series]#($series)#|[.align-right]#$author#" >> $DEST_FILE + echo "|link:https://openlibrary.org/isbn/$isbn[$title] [.series]#($series)#|$author" >> $DEST_FILE fi done < "$BOOKLIST_FILE" - echo -e "|===\n{empty} +\n{empty} +" >> $DEST_FILE + echo "|===" >> $DEST_FILE cd $NGINX_DIR + get_page_footer >> $DEST_FILE asciidoctor $DEST_FILE rm $DEST_FILE } @@ -143,14 +157,11 @@ generate_links_page() { test -n "$category" && echo -e "\n== $category\n" >> $DEST_FILE category_check=$category fi - if [[ -n $image ]]; then - echo "* image:$image[$title,width=12,height=12] link:$url[$title] - $description" >> $DEST_FILE - else - echo "* link:$url[$title] - $description" >> $DEST_FILE - fi + echo "* link:$url[$title] - $description" >> $DEST_FILE done < "$LINKS_FILE" cd $NGINX_DIR + get_page_footer >> $DEST_FILE asciidoctor $DEST_FILE rm $DEST_FILE } @@ -159,12 +170,16 @@ generate_rss() { cd $BLOG_REPO_DIR echo '<rss version="2.0"><channel><title>Wim Dupont - Blog</title><link>https://wimdupont.com/blog</link><language>en</language>' > $RSS_DEST_FILE readarray -t files < <(stat -c '%Y %n' * | sort -n -r) + for file in "${files[@]#* }" ; do filename=$(basename "${file}" .adoc) + date=$(stat -c '%y' "$file") + asciidoctor -e "$file" content=$(cat "${filename}.html" | sed 's/</\&lt;/g') + rm "${filename}.html" - date=$(stat -c '%y' "$file") + echo "<item> <title>$filename</title> <description>$content</description> @@ -183,8 +198,8 @@ generate_books_page generate_links_page generate_pages $PAGES_REPO_DIR $NGINX_DIR -generate_pages $GUIDE_REPO_DIR $GUIDE_DEST_DIR "../" -generate_pages $BLOG_REPO_DIR $ARTICLES_DEST_DIR "../" +generate_pages $GUIDE_REPO_DIR $GUIDE_DEST_DIR "../" 1 +generate_pages $BLOG_REPO_DIR $ARTICLES_DEST_DIR "../" 1 generate_href_page "guides" "guide" $GUIDE_DEST_DIR generate_href_page "blog" "articles" $ARTICLES_DEST_DIR 1 diff --git a/images/git.png b/images/git.png Binary files differ. diff --git a/images/rssfeed.png b/images/rssfeed.png Binary files differ. diff --git a/main.css b/main.css @@ -1,7 +1,6 @@ body { - background: linear-gradient(black, #000d1a) fixed; + background: #000; color: #e8e8e8; - margin-bottom: 100px ; font-family: sans-serif; max-width: 960px; margin: 0 auto; @@ -31,42 +30,42 @@ li p { margin-block: 0.5em; } -img { - filter: grayscale(30%); -} - a { text-decoration: none; - color: #e39777; + color: #56c8ff; } a:hover { text-decoration: underline; } -/* == classes == */ - -.subheader { - color: #f4a460; +.nav { text-align: center; - margin: 30px; + font-weight: bold; + margin-top: 3em; + margin-bottom: 2.5em; } -.navimg { - padding: 2px; +.nav a { + padding: 1em; } -.navimg:hover { - text-decoration: none; +.subheader { + color: #bdbdbd; + text-align: center; + padding-bottom: 0.4em; } -.nav-space-left { - padding-left: 80px; +.imageblock { + display: grid; + place-content: center; + gap: 0.3em; } -.source-credit { - text-align: right; +.imageblock .title { + text-align: center; font-size: 60%; + text-align: right; } .center { @@ -75,59 +74,28 @@ a:hover { .series { font-size: 80%; - color: #8f5a44; -} -.title { - color: orange; -} - -.header { - text-align: center; - margin: 40px; - color: #cb8a1e; -} - -.nav { - display: block; - text-align: left; - align-items: center; - flex-wrap: wrap; - border-bottom: 1px solid grey;; - max-width: 900px; -} - -.nav-a { - padding: 10px; -} - -.nav-right { - float: right; - text-indent: 10px; + color: #1faaaf; } .language-java, .language-bash, .language-conf { - padding: 12px; - display: grid; + padding: 1em; + display: block; background-color: #5555; font-size: 120%; overflow-x: auto; + white-space: break-spaces; } .language-conf { background-color: #cc9d9d54; } -/* == (altered) asciidoctor.css == */ +p.tableblock{ + margin-block: 0.3em; +} -p.tableblock{margin-block: 0.3em;} -td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere} -td.tableblock>.content>:last-child{margin-bottom:-1.25em} -th.halign-left,td.halign-left{text-align:left} -th.halign-right,td.halign-right{text-align:right} -th.halign-center,td.halign-center{text-align:center} -th.valign-top,td.valign-top{vertical-align:top} -th.valign-bottom,td.valign-bottom{vertical-align:bottom} -th.valign-middle,td.valign-middle{vertical-align:middle} -table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede} +th.halign-right,td.halign-right{ + text-align:right +} diff --git a/pages/donate.adoc b/pages/donate.adoc @@ -1,4 +1,4 @@ -[.subheader,center] +[.subheader] -- [discrete] == Monero (XMR) @@ -10,7 +10,7 @@ image::files/images/xmr-qrcode.png[link=files/images/xmr-qrcode.png,alt=XMR addr 89u7U4Yboyr5qCbR5qHo6qXtYHhgbpWFQ19TsPkZVdrjWtgCr7qz4Ru7MD4kuT9RN62apATjaz5RrgoSk2HwgJDz4f6wEFN -- -[.subheader,center] +[.subheader] -- [discrete] == Bitcoin (BTC) diff --git a/pages/error/50x.adoc b/pages/error/50x.adoc @@ -5,7 +5,6 @@ :linkcss: :favicon: files/favicon.png -[.container.wrapper] = Error == An error occurred. diff --git a/pages/footer/footer.adoc b/pages/footer/footer.adoc @@ -0,0 +1,6 @@ + +[.nav] +-- +image:{root_nav}files/images/git.png[title=Git,alt=Git,width=25,height=25,link="https://git.wimdupont.com"] +image:{root_nav}files/images/rssfeed.png[title=RSS,alt=RSS,width=25,height=25,link="{root_nav}rss.xml"] +-- diff --git a/pages/header/header.adoc b/pages/header/header.adoc @@ -1,25 +1,18 @@ :title: {title} - Wim Dupont +:noheader: :nofooter: :stylesheet: main.css :stylesdir: {root_nav}stylesheets :linkcss: -:favicon: {root_nav}files/favicon.png +:favicon: {root_nav}files/images/favicon.png -[.home-title.header] +[.nav] -- -[discrete] -= {title} --- - -[.nav.wrapper.header] --- -[.nav-a]#link:{root_nav}home[&#x1F3E0; Home]# -[.nav-a]#link:{root_nav}books[&#x1F4DA; Books]# -[.nav-a]#link:{root_nav}blog[&#x1F4DD; Blog]# -[.nav-a]#link:{root_nav}guides[&#x1F481; Guides]# -[.nav-a]#link:{root_nav}links[&#x1F517; Links]# -[.nav-a]#link:{root_nav}contact[&#x1F4E7; Contact]# -[.nav-a]#link:{root_nav}donate[&#x1F4B0; Donate]# -[.nav-right]#image:{root_nav}files/images/rssfeed.png[alt=RSS,width=20,height=20,link="{root_nav}rss.xml"]# -[.nav-right]#image:{root_nav}files/images/git.png[alt=Git,width=20,height=20,link="https://git.wimdupont.com"]# +link:{root_nav}home[Home] +link:{root_nav}books[Books] +link:{root_nav}blog[Blog] +link:{root_nav}guides[Guides] +link:{root_nav}links[Links] +link:{root_nav}contact[Contact] +link:{root_nav}donate[Donate] -- diff --git a/pages/home.adoc b/pages/home.adoc @@ -1,7 +1,7 @@ +:figure-caption!: + [.subheader] Welcome to my webpage -image::files/images/TheWayOfKings.png[alt=The Way of Kings, width=960] - -[.source-credit] -Original art by Michael Whelan +.Original art by Michael Whelan +image::files/images/TheWayOfKings.png[alt="The Way of Kings", width=700]