Skip to content

Commit

Permalink
Make Page 1.1.0: pages dir & prep for day pages
Browse files Browse the repository at this point in the history
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: drzhelnov/zheln.github.io#101
  • Loading branch information
pvzhelnov committed Nov 18, 2020
1 parent 569f13e commit 083587a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion zheln/Worked_Time_Log.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
24 changes: 16 additions & 8 deletions zheln/make-page.sh
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions zheln/unspecified.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
title: Unspecified
make-smaller-titles: false
specialty_tag: unspecified
permalink: /unspecified/
---

<div class="container-fluid index error">
Expand Down

0 comments on commit 083587a

Please sign in to comment.