commit 8a8efb0c2893c725a8c67640490356034efdd439
parent b5235402d3f4794488963cfc78f88b1cb3fbd9ea
Author: Matsuda Kenji <contact2655@matsudakenji.xyz>
Date: Thu, 14 Jul 2022 19:52:58 +0900
move draft
Diffstat:
4 files changed, 1 insertion(+), 88 deletions(-)
diff --git a/README.md b/README.md
@@ -1,3 +1,3 @@
# kagero
-static site generator and blog manuscripts
+blog manuscripts
diff --git a/bin/update b/bin/update
@@ -1,69 +0,0 @@
-#!/bin/sh -e
-#TODO update not work after _(footer|header).html update
-
-cd $(dirname $0)/..
-man=$(pwd)/man
-pub=$(pwd)/pub
-url="https://www.mtkn.jp"
-
-ignore=$(printf ' ! -name "." ! -path "*/_*" ! -path "*/.*" ')
-
-list_dirs(){
- cd "$man" && eval "find . -type d $ignore"
-}
-
-list_dependent_files(){
- e="\\( -name '*.html' -o -name '*.css' -o -name '*.js' \\)"
- cd "$man" && eval "find . -type f $ignore $e"
-}
-
-list_files_to_replace(){
- fs=$(cd "$man" && eval "find . -type f ! -name '.' $ignore -newer $pub/.files")
- if echo "$fs" | grep -qE '^./_.*\.html$|^./_.*\.js$|^./_.*\.css$'; then
- list_dependent_files
- else
- echo "$fs"
- fi
-}
-
-render_sitemap(){
- echo '<?xml version="1.0" encoding="UTF-8"?>'
- echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
- (cd $pub && find . -name '*.html' | xargs ls -lT ) |
- awk '{print $9 "-" $6 "-" $7, $10}' |
- sed 's/\(^....-\)Jan/\101/;s/\(^....-\)Feb/\102/;s/\(^....-\)Mar/\103/;
- s/\(^....-\)Apr/\104/;s/\(^....-\)May/\105/;s/\(^....-\)Jun/\106/;
- s/\(^....-\)Jul/\107/;s/\(^....-\)Aug/\108/;s/\(^....-\)Sep/\109/;
- s/\(^....-\)Oct/\110/;s/\(^....-\)Nov/\111/;s/\(^....-\)Dec/\112/;
- s/\(^[^ ]* \)\./\1/; s;/index.html$;/;' |
- sed -E 's;(^....-..-..?) (.*$);<url><loc>'"$url"'\2</loc><lastmod>\1</lastmod></url>;'
- echo '</urlset>'
-}
-
-# main
-list_dirs | (cd "$man" && cpio -pdu "$pub")
-fs=$(
- if [ -f "$pub/.files" ]; then
- list_files_to_replace
- else
- cd "$man" && eval "find . -type f $ignore"
- fi
-)
-if [ -n "$fs" ]; then
- echo "$fs" | tee "$pub/.files"
- echo "$fs" | grep '\.html$' |
- while read f; do
- title=$(grep '<h1>' "$man/$f" | sed -E 's/<\/?h1>//g')
- cat "$man"/_header.html "$man/$f" $man/_footer.html |
- sed 's/<!--title-->/'"$title"'/' > "$pub/$f"
- touch -r "$man/$f" "$pub/$f"
- done
- echo "$fs" | grep -Ev '\.html$' |
- (cd "$man" && cpio -pu "$pub")
-fi
-
-(cd $man && find .) | sed 's/^.*$/\! -path "&"/' | tr '\n' ' ' |
- sed 's;^.*$;\(cd '$pub' \&\& find . \! -path ./.files & -delete\);' |
- sh -s
-
-render_sitemap > "$pub/sitemap.xml"
diff --git a/bin/weblog b/bin/weblog
@@ -1,18 +0,0 @@
-#!/bin/sh
-# list html files with modified date and sort them newest fast
-# bugs: can't display titles with white spaces
-
-cd $(dirname $0)/..
-man=$(pwd)/man
-pub=$(pwd)/pub
-url="https://www.matsudakenji.xyz"
-
-ignore=$(printf ' ! -path "./index.html" ! -path "./blog/blog_index.html" ! -path "./about.html" ! -path "./error/*" ! -path "./draft/*"')
-
-(cd "$pub" && eval "find . -name '*.html' $ignore" | xargs ls -lT) |
- awk '{printf "%d %s %02d %s\n", $9, $6, $7, $10}' |
- mn | sort -r -k3 | sort -r -s -k2 | sort -r -s -k1 |
- awk '{printf "(cd man && printf \"%s %s %s %s \"; \
- grep \"<h1>\" %s | sed -E '"\'s/<[^>]*>//g;\'"')\n",$1,$2,$3,$4,$4}' |
- while read c; do sh -c "$c"; done | sed 's/\.//' |
- awk '{printf "<li>%s-%s-%s <a href=\"%s\">%s</a></li>\n", $1,$2,$3,$4,$5}'
diff --git a/man/plants/myrica_rubra.html b/man/draft/myrica_rubra.html