diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-08 21:30:23 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-08 21:30:23 +0800 |
| commit | bce6be90883b107285faa56acf0081b54daa3aa9 (patch) | |
| tree | 0893f99b5debe074f1596b6cfc6d3c86da34ca42 /scripts/publish-raw | |
Initialize personal website
Diffstat (limited to 'scripts/publish-raw')
| -rwxr-xr-x | scripts/publish-raw | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/publish-raw b/scripts/publish-raw new file mode 100755 index 0000000..09048f3 --- /dev/null +++ b/scripts/publish-raw @@ -0,0 +1,33 @@ +#!/bin/sh + +set -eu + +content_dir=${1:-content} +public_dir=${2:-public} + +[ -d "$content_dir" ] || exit 0 +mkdir -p "$public_dir" + +find "$content_dir" -type f -print | while IFS= read -r source +do + relative=${source#"$content_dir"/} + + case "$relative" in + journal/_index.md) + target=$public_dir/journal/_index.md + ;; + journal/*/*/*/*) + target=$public_dir/${relative#journal/} + ;; + journal/*) + # The V1 model has no public year or month section documents. + continue + ;; + *) + target=$public_dir/$relative + ;; + esac + + mkdir -p "$(dirname "$target")" + cp "$source" "$target" +done |
