From 083587ac2b75f47875f0792ad5f8e80b55d22c29 Mon Sep 17 00:00:00 2001 From: Pavel Zhelnov Date: Wed, 18 Nov 2020 13:30:41 +0300 Subject: [PATCH] Make Page 1.1.0: pages dir & prep for day pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved so that these files didn’t flood root repo page on GitHub and so that all generated by Make Page was in one place. Ref. regarding day pages: https://github.com/drzhelnov/zheln.github.io/issues/101 --- zheln/Worked_Time_Log.md | 2 +- zheln/make-page.sh | 24 ++++++++++++++++-------- zheln/unspecified.html | 1 + 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/zheln/Worked_Time_Log.md b/zheln/Worked_Time_Log.md index 6d223d394..64ee1d231 100644 --- a/zheln/Worked_Time_Log.md +++ b/zheln/Worked_Time_Log.md @@ -2,4 +2,4 @@ |------|-------------------|------------------| | Wk 45, 2020 | 24h 39m | 48h | | Wk 46, 2020 | 18h 32m | 48h | -| Wk 47, 2020 | 6h 20m | 48h | +| Wk 47, 2020 | 11h 53m | 48h | diff --git a/zheln/make-page.sh b/zheln/make-page.sh index 39308a5d2..42f661dab 100644 --- a/zheln/make-page.sh +++ b/zheln/make-page.sh @@ -1,5 +1,5 @@ #!/bin/bash -v='1.0.0' +v='1.1.0' coreutils=true files='zheln_ama_specialty_page_filenames.lst' html='unspecified.html' @@ -9,6 +9,8 @@ titles='zheln_ama_specialty_titles.lst' unspecified_tag='unspecified' unspecified_code='US' unspecified_title='Unspecified' +pages='pages' +specialty='specialty' echo "> I am Make Page v$v. > ’kay, want coreutils? $coreutils @@ -29,29 +31,35 @@ if else echo '> Text files in place.' fi -if [ -d "pages" ]; then +if [ -d "$pages" ]; then echo '> Leftovers present. Check with them first.' exit 1 else echo '> No leftovers detected.'; echo '> Proceed to execution…' fi -mkdir pages; cd pages +mkdir "$pages"; cd "$pages" i=0; k=0 +mkdir "$specialty"; cd "$specialty" while read file; do - cp "../$html" "$file" + cp "../../$html" "$file" content=$(< $file); while read title; do if [ "$k" = "$i" ]; then echo "${content/title: $unspecified_title/title: $title}" > "$file"; fi k=$((k + 1)) - done < "../$titles"; k=0 + done < "../../$titles"; k=0 content=$(< $file); while read tag; do if [ "$k" = "$i" ]; then echo "${content/$unspecified_tag/$tag}" > "$file"; fi k=$((k + 1)) - done < "../$tags"; k=0 + done < "../../$tags"; k=0 + content=$(< $file); while read tag; do + tag="${tag// /-}" + if [ "$k" = "$i" ]; then echo "${content/permalink: \/$unspecified_tag\//permalink: /$tag/}" > "$file"; fi + k=$((k + 1)) + done < "../../$tags"; k=0 content=$(< $file); while read code; do if [ "$k" = "$i" ]; then echo "${content/site.$unspecified_code/site.$code}" > "$file"; fi k=$((k + 1)) - done < "../$codes"; k=0 + done < "../../$codes"; k=0 i=$((i + 1)) -done < "../$files" +done < "../../$files" echo '> Mission accomplished.'; exit 0 diff --git a/zheln/unspecified.html b/zheln/unspecified.html index feb90e2a5..88d28d8d0 100644 --- a/zheln/unspecified.html +++ b/zheln/unspecified.html @@ -3,6 +3,7 @@ title: Unspecified make-smaller-titles: false specialty_tag: unspecified +permalink: /unspecified/ ---