From 9934dd538b0ce116e3b1600272cb46369b082246 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 2 Feb 2022 13:34:47 +0800 Subject: init commit --- www/.gitignore | 1 + www/Makefile | 14 +++ www/assets/favicon.ico | Bin 0 -> 549 bytes www/assets/gpg.asc | 84 ++++++++++++++++++ www/assets/robots.txt | 4 + www/assets/style.css | 213 ++++++++++++++++++++++++++++++++++++++++++++++ www/assets/wp-admin.php | 1 + www/scripts/add-graph.py | 35 ++++++++ www/scripts/build.sh | 188 ++++++++++++++++++++++++++++++++++++++++ www/templates/footer.html | 4 + www/templates/head.html | 10 +++ www/templates/header.html | 17 ++++ www/templates/index.md | 1 + 13 files changed, 572 insertions(+) create mode 100644 www/.gitignore create mode 100644 www/Makefile create mode 100644 www/assets/favicon.ico create mode 100644 www/assets/gpg.asc create mode 100644 www/assets/robots.txt create mode 100644 www/assets/style.css create mode 100644 www/assets/wp-admin.php create mode 100755 www/scripts/add-graph.py create mode 100755 www/scripts/build.sh create mode 100644 www/templates/footer.html create mode 100644 www/templates/head.html create mode 100644 www/templates/header.html create mode 100644 www/templates/index.md (limited to 'www') diff --git a/www/.gitignore b/www/.gitignore new file mode 100644 index 0000000..364fdec --- /dev/null +++ b/www/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/www/Makefile b/www/Makefile new file mode 100644 index 0000000..80b9d47 --- /dev/null +++ b/www/Makefile @@ -0,0 +1,14 @@ +.ONESHELL: +ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) + +# build html files for public/ +build: + @input_dir=~/log/posts \ + output_dir=/srv/http \ + assets_dir=$(ROOT_DIR)assets \ + template_dir=$(ROOT_DIR)templates \ + $(ROOT_DIR)scripts/build.sh + +# Migrage frontmatter from '---' to HTML comment '' +frontmatter: + find content -type f -name '*.md' | xargs sed -i ':frontmatter { 1s/^---//; 1!b}; /^---/ {1b frontmatter}' diff --git a/www/assets/favicon.ico b/www/assets/favicon.ico new file mode 100644 index 0000000..5af1857 Binary files /dev/null and b/www/assets/favicon.ico differ diff --git a/www/assets/gpg.asc b/www/assets/gpg.asc new file mode 100644 index 0000000..f33181e --- /dev/null +++ b/www/assets/gpg.asc @@ -0,0 +1,84 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQGNBGAzCdIBDACvt2iu+FTg+p3Q5p/J8Q7643g61n3kgIgDt9a5JU06nwAGDmX+ +hIrVy5OxsTntJzRkvV+nr0cR9Suvkci9RfJ9TixjMca+Eld3pPLhdPGmtPofjCaj +LpKMkPdHg+VU4B7BANwsd/on7VYLq5Ko6dj1HKrp3KJappP5njK1u39DQHjLPEjK +976nyErOdKNVjswIWdLFJgWhC46mH3zW4aOtkw8UIn32fbCmpZyuVU8ooJTbIl6+ +YvU9BsYRgEhSjQbi+RXQZAyUqsQlZnS8/81pwanKs6NFqBSTFaryHVfbC1McXHNY +V3+Y/rGEmUIn2FXhHWWHb8b5oBroZQLbHVpjWV3DZgkTN0c8g+K3hQ1iLFAdWuQg +wxBuzkq/5AMiqJ/0gUjkT4uW12fIEQR30wvveVDq/BMWdhC4tgy+ft5QcBjA3xj2 +xC813/r3cvgfWaJvB5/mUH4QPv1gESG9QdjAVOBMt/TTnKJFes5iuq1q0+ZdnG0S +KZ1aFlfbGgZWcW8AEQEAAbQvdHlwZWJyb29rIDx0eXBlYnJvb2tAZ21haWwuY29t +PiAoR21haWwgQWNjb3VudCmJAdQEEwEIAD4WIQQSgUZMDGWhjNgJ9OxmRzq+mhjP +LQUCYEnKDgIbAwUJA8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRBmRzq+ +mhjPLe7zC/9/6O4+icJc74Y/d/VhJv4k/Zc3b2ZlMrdGq/FDQTYSISPPo2k6hgcS +IQw2SPNb0hRkoaj7Dj3tMFzumSrGMyfGNXHThYWh3UABSTkTnYIXMNhd+on7VpfZ +FqkBrIfgv+Im7Gops66L7x9b3BT16yxb373uG9bhe+w/Kzk8Mix6f57M9f21f/MI +tr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www/assets/robots.txt b/www/assets/robots.txt new file mode 100644 index 0000000..41f82c4 --- /dev/null +++ b/www/assets/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://topo.tw/sitemap.xml diff --git a/www/assets/style.css b/www/assets/style.css new file mode 100644 index 0000000..2752323 --- /dev/null +++ b/www/assets/style.css @@ -0,0 +1,213 @@ +header { + display: flex; + justify-content: space-between; + margin-top: 1rem; +} + +footer * { + display: inline; +} + +blockquote { + color: gray; + font-size: 1.2rem; + font-style: italic; + + text-align: center; +} + +p code { + margin-inline: 0.2rem; + padding-inline: 6px; +} + +/* Neat CSS: https://neat.joeldare.com */ +* { + box-sizing: border-box; +} + +:root { + color-scheme: light dark; + --light: #fff; + /* --light: #f7f7f7; */ + --lesslight: #efefef; + --dark: #404040; + --moredark: #000; + /*--link: royalblue; */ + --link: #850000; + --link-highlight-color: #ffdcda; + /* border-top: 5px solid var(--dark); */ + line-height: 1.5em; + font-family: system-ui, sans-serif; + font-size: 16px; + color: var(--dark); +} + +h1 { + line-height: 1em; +} + +button, input { + font-size: 1em; /* Override browser default font shrinking*/ +} + +input { + border: 1px solid var(--dark); + background-color: var(--lesslight); + border-radius: .25em; + padding: .5em; +} + +pre { + background-color: var(--lesslight); + margin: 0.5em 0 0.5em 0; + padding: 0.5em; + overflow: auto; +} + +code { + background-color: var(--lesslight); +} + +body { + background-color: var(--light); + margin: 0; + max-width: 800px; + padding: 0 20px 20px 20px; + margin-left: auto; + margin-right: auto; +} + +a { + outline: none; + text-decoration: underline 2px var(--link-highlight-color); + color: var(--link); +} + +a:hover { + background: var(--link-highlight-color); +} + +img { + max-width: 100%; + height: auto; +} + +button, .button, input[type=submit] { + display: inline-block; + background-color: var(--dark); + color: var(--light); + text-align: center; + padding: .5em; + border-radius: .25em; + text-decoration: none; + border: none; + cursor: pointer; +} + +button:hover, .button:hover, input[type=submit]:hover { + color: var(--lesslight); + background-color: var(--moredark); +} + +/* Add a margin between side-by-side buttons */ +button + button, .button + .button, input[type=submit] + input[type=submit] { + margin-left: 1em; +} + +.center { + display: block; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.bordered { + border: 3px solid; +} + +.home { + display: inline-block; + background-color: var(--dark); + color: var(--light); + margin-top: 20px; + padding: 5px 10px 5px 10px; + text-decoration: none; + font-weight: bold; +} + + +/* Desktop sizes */ +@media (min-width: 600px) { + ol.twocol { + column-count: 2; + } + + .row { + display: flex; + flex-direction: row; + padding: 0; + width: 100%; + } + + /* Make everything in a row a column */ + .row > * { + display: block; + flex: 1 1 auto; + max-width: 100%; + width: 100%; + } + + .row > *:not(:last-child) { + margin-right: 10px; + } +} + +/* Dark mode overrides (confusingly inverse) */ +@media (prefers-color-scheme: dark) { + :root { + --light: #222; + --lesslight: #333; + --dark: #eee; + --moredark: #fefefe; + } + /* This fixes an odd blue then white shadow on FF in dark mode */ + *:focus { + outline: var(--light); + box-shadow: 0 0 0 .25em var(--link); + } +} + +/* Printing */ +@media print { + .home { + display: none; + } +} + +[data-tooltip]{ + display: inline-block; + position: relative; + + &::after { + display: block; + position: absolute; + content: attr(data-tooltip); + background: var(--dark); + color: var(--lesslight); + padding: .25em; + cursor: default; + user-select: text; + + transition: + visibility .3s ease-out, + opacity .3s ease-out; + visibility: hidden; + opacity: 0; + } + + &:hover::after { + opacity: 1; + visibility: visible; + } +} diff --git a/www/assets/wp-admin.php b/www/assets/wp-admin.php new file mode 100644 index 0000000..b774c98 --- /dev/null +++ b/www/assets/wp-admin.php @@ -0,0 +1 @@ +Got you! diff --git a/www/scripts/add-graph.py b/www/scripts/add-graph.py new file mode 100755 index 0000000..455b45a --- /dev/null +++ b/www/scripts/add-graph.py @@ -0,0 +1,35 @@ +#! /bin/python3 + +import sys, subprocess +from datetime import date +from bs4 import BeautifulSoup + +def handle(html): + soup = BeautifulSoup(html, 'html.parser') + for graph in soup.select('pre.language-graph'): + print() + print(date.today().strftime("%H:%M:%S")) + print('before:') + print(graph.string) + + process = subprocess.Popen( + ["/usr/bin/vendor_perl/graph-easy", "--boxart"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) + output, error = process.communicate(input=graph.get_text().encode()) + graph.string = output.decode() + + print('After:') + print(graph.string) + print('Error:') + print(error.decode()) + return str(soup) + +for line in sys.stdin: + file = line.rstrip("\n") + with open(file, 'r') as html: + new_content = handle(html) + with open(file, 'w') as html: + html.write(new_content) diff --git a/www/scripts/build.sh b/www/scripts/build.sh new file mode 100755 index 0000000..9b95c99 --- /dev/null +++ b/www/scripts/build.sh @@ -0,0 +1,188 @@ +#! /bin/bash + +set -e + +# Executable command for markdown +markdown_bin="markdown -f fencedcode,autolink,alphalist,autolink,footnote" + +# Directory for input/output +input_dir=${input_dir:?ENV \"input_dir\" is not set} +output_dir=${output_dir:?ENV \"output_dir\" is not set} +assets_dir=${assets_dir:?ENV \"assets_dir\" is not set} +template_dir=${template_dir:?ENV \"template_dir\" is not set} + +# functions {{{ + +# add indent for each line except
+indent() {
+  indent="$(printf "%${1}s")"
+  sed "s/^/${indent}/; /
/!b; :pre; N; /<\/pre>/!b pre"
+}
+
+# use heredoc to generate html from .md file and templates
+html() {
+  <<-END_OF_HTML sed '1d;$d'
+
+	
+	
+	${head}
+	
+	${header}
+	  

+
+ $(${markdown_bin} | indent 4) +
+

+ ${footer} + + + + END_OF_HTML +} + +# list of latest posts in markdown format +latest_posts() { + (IFS=$'\n'; echo "${index_list[*]}") | sort -r | head -20 | while read date path title; do + echo "- [$title](/$path)" + done +} + +# print frontmatter from markdown file with format: " " +get_frontmatter() { + sed -n '1 {//q; s/"//g; s/://p' +} + +# process frontmatter +add_index() { + unset title public index date draft + + # define local variables for frontmatter + while read key value; do + local -r $key="$value" + done <<<"$(get_frontmatter)" + + # don't process draft after function call + test "$draft" != "" && return 1 + + # skip making index in some cases + test "$public" = false && return 0 + test "$index" = false && return 0 + test "$type" = demo && return 0 + test "$title" = "" && return 0 + iso8601=$(date --iso --date "${date:-NULL}" 2>/dev/null) + test "$iso8601" = "" && return 0 + + # put frontmatter info into variable "index" if title and date are valid + index_list+=("$iso8601 $path $title") +} + +# remove SGML comments but keep the top one as frontmatter +ignore_comment() { + sed '1 !{ /^$/ d }' +} + +# Generate the feed file +make_rss() { + echo -n "Making RSS " + + rssfile=$blog_feed.$RANDOM + while [[ -f $rssfile ]]; do rssfile=$blog_feed.$RANDOM; done + + { + pubdate=$(LC_ALL=C date +"$date_format_full") + cat <<-EOF + ' + ' + Dummy Websitehttps://topo.tw/index.xml" + $global_descriptionen" + $pubdate" + $pubdate" + " + EOF + + n=0 + while IFS='' read -r i; do + is_boilerplate_file "$i" && continue + ((n >= number_of_feed_articles)) && break # max 10 items + echo -n "." 1>&3 + echo '' + get_post_title "$i" + echo '$global_url/${i#./}" + echo "$global_url/$i" + echo "$(get_post_author "$i")" + echo "$(LC_ALL=C date -r "$i" +"$date_format_full")" + + n=$(( n + 1 )) + done < <(ls -t ./*.html) + + echo '' + } 3>&1 >"$rssfile" + echo "" + + mv "$rssfile" "$blog_feed" + chmod 644 "$blog_feed" +} + +# }}} +# prepare directory for outputs {{{ + +mkdir -p $output_dir/ +rm -rf $output_dir/** +ln -s $assets_dir/* $output_dir/ + +# }}} +# content of templates {{{ + +head="$(cat $template_dir/head.html)" +header="$(cat $template_dir/header.html | indent 2)" +footer="$(cat $template_dir/footer.html | indent 2)" +index_list=() +index_template="$(cat $template_dir/index.md)" + +# }}} +# for each markdown file {{{ + +files="$(find "$input_dir" -type f -name '*md')" +total=$(wc -l <<<"$files") +declare -i counter +for file in $files; do + # set variables + path=$(<<<"$file" sed "s#^${input_dir}/##; s/\.md$//").html; mkdir -p $(dirname $output_dir/$path) + content="$(cat ${file} | ignore_comment)" + + # use frontmatter to decide making html file or not + <<<"$content" add_index || continue + + # log + echo -e "\033[1K\r$((counter+=1))/$total \t\t processing $path" + + # make html file for draft + h1="$(<<<"$content" get_frontmatter | sed -n 's/^title *//p')" + echo "$content" \ + | tee $output_dir/${file#${input_dir}/} \ + | { [ -n "$h1" ] && echo "# $h1"; cat; } \ + | html >$output_dir/$path +done +echo + +# }}} +# make index.html {{{ + +{ + echo "${index_template}" + echo -e '

\n\n' + latest_posts +} \ +| tee $output_dir/index.md \ +| html >$output_dir/index.html + +echo -e index.html "\t" generated + +# }}} +# make index.xml {{{ + + + +# }}} diff --git a/www/templates/footer.html b/www/templates/footer.html new file mode 100644 index 0000000..9e87e02 --- /dev/null +++ b/www/templates/footer.html @@ -0,0 +1,4 @@ + diff --git a/www/templates/head.html b/www/templates/head.html new file mode 100644 index 0000000..ede99c9 --- /dev/null +++ b/www/templates/head.html @@ -0,0 +1,10 @@ + + + + + + Dummy Site + + + + diff --git a/www/templates/header.html b/www/templates/header.html new file mode 100644 index 0000000..a77079a --- /dev/null +++ b/www/templates/header.html @@ -0,0 +1,17 @@ +
+ + +
diff --git a/www/templates/index.md b/www/templates/index.md new file mode 100644 index 0000000..5743a19 --- /dev/null +++ b/www/templates/index.md @@ -0,0 +1 @@ +> There should be a intro for this site, but I cannot came up with any idea about this... -- cgit v1.2.3-70-g09d2