diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-12-15 19:42:53 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-12-16 22:45:13 +0800 |
commit | 1cb80b2d9f3245bfc9e3f02f84b6af681054131a (patch) | |
tree | 47cbb38ce9e7b3e92b0262e35bf8dfcdbe929526 /www/scripts | |
parent | 465c4ba5b4f0b4f69fd3773fc4f9f9650b7fffa0 (diff) |
add cgit
Diffstat (limited to 'www/scripts')
-rwxr-xr-x | www/scripts/build.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/www/scripts/build.sh b/www/scripts/build.sh index 23c4a70..8bf6ffc 100755 --- a/www/scripts/build.sh +++ b/www/scripts/build.sh | |||
@@ -29,7 +29,7 @@ comment_block() { | |||
29 | <<-COMMENT cat | 29 | <<-COMMENT cat |
30 | <div style="border-radius: 6px; background: lightyellow"> | 30 | <div style="border-radius: 6px; background: lightyellow"> |
31 | <a style="display: inline-block; margin: 0.5em 0.5em 0 0; float: right" href="mailto:comment@topo.tw?subject=Comment on page: ${path}">[Comment on this page]</a> | 31 | <a style="display: inline-block; margin: 0.5em 0.5em 0 0; float: right" href="mailto:comment@topo.tw?subject=Comment on page: ${path}">[Comment on this page]</a> |
32 | <object type="text/html" data="/${path/.html}.comment.html" onload="observeResize(this)" style="width: 100%;"></object> | 32 | <object type="text/html" data="/${path/%html/comment.html}" onload="observeResize(this)" style="width: 100%;"></object> |
33 | <script> | 33 | <script> |
34 | function observeResize(commentBlock) { | 34 | function observeResize(commentBlock) { |
35 | const doc = commentBlock.contentDocument.documentElement | 35 | const doc = commentBlock.contentDocument.documentElement |
@@ -70,7 +70,7 @@ html() { | |||
70 | 70 | ||
71 | latest_posts() { | 71 | latest_posts() { |
72 | (IFS=$'\n'; echo "${index_list[*]}") | sort -r | head -20 | while read date path title; do | 72 | (IFS=$'\n'; echo "${index_list[*]}") | sort -r | head -20 | while read date path title; do |
73 | echo "- <time datetime="$date">$date</time> [$title](/$path)" | 73 | echo "- <time title=\"$(date --rfc-email -d "$date")\" datetime=\"$date\">$date</time> [$title](/$path)" |
74 | done | 74 | done |
75 | } | 75 | } |
76 | 76 | ||
@@ -186,7 +186,7 @@ for file in $files; do | |||
186 | <<<"$content" check_frontmatter || continue | 186 | <<<"$content" check_frontmatter || continue |
187 | 187 | ||
188 | # log | 188 | # log |
189 | echo -e "\033[1K\r$((counter+=1))/$total \t\t processing $path" | 189 | echo -e "\033[1K\r$((counter+=1))/$total\t\tprocessing $path" |
190 | 190 | ||
191 | # add original content to $OUTPUT_DIR | 191 | # add original content to $OUTPUT_DIR |
192 | # and generate html file with <h1> | 192 | # and generate html file with <h1> |