summaryrefslogtreecommitdiffstats
path: root/publish.sh
blob: 59be04d6d09e6d12f898e3b19b4a2925af361814 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

#word_counter=$(find ~/blog/content/ -type f -name "*.md" -exec cat {} + | \
#perl -CSD -pe 's/[\p{P}\p{S}\s\p{M}\p{C}\p{Z}]//g; s/$$.*?$$$$.*?$$//g; s/[*#_\-`~=+|><\^]//g; s/\!$$.*?$$$$.*?$$//g' | \
#grep -oP '[\p{Han}a-zA-Z]' | \
#wc -m)

commit_date=$(date +"%Y-%m-%d %H:%M:%S")
    cd ~/blog/public || exit 1
    hugo --cleanDestinationDir --gc
    git add .
    git commit -m "auto update: $commit_date"
    git push origin main