diff --git a/.github/workflows/blogtini.yml b/.github/workflows/blogtini.yml index de0d6a1..e1300e3 100644 --- a/.github/workflows/blogtini.yml +++ b/.github/workflows/blogtini.yml @@ -47,6 +47,7 @@ jobs: uses: actions/checkout@v4 with: lfs: true + fetch-depth: 0 - name: Setup Pages uses: actions/configure-pages@v5 - name: Blogtini setup @@ -65,11 +66,6 @@ jobs: export DENO_INSTALL="/home/runner/.deno" export PATH="$DENO_INSTALL/bin:$PATH" - # xxxcc - ls .git - git log -1 --format='%cI' -- about/index.html - git config remote.origin.url - # setup SEO headers & create sitemap ./_blogtini/bin/ssr.sh if [ ! -e sitemap.xml ]; then ./_blogtini/bin/sitemap; fi diff --git a/bin/sitemap b/bin/sitemap index c0b349b..2ad4322 100755 --- a/bin/sitemap +++ b/bin/sitemap @@ -5,11 +5,16 @@ if [ ! -e config.yml ]; then exit 1 fi -NAME=$(git config remote.origin.url |cut -f2 -d: |cut -d/ -f1) -REPO=$(git config remote.origin.url |cut -f2 -d: |cut -d/ -f2) - -PREFIX=https://$NAME.github.io/$REPO -[ -e CNAME ] && PREFIX=https://$(cat CNAME) +if [ -e CNAME ]; then + PREFIX=https://$(cat CNAME) +else + # examples of remote.origin.url: + # https://github.com/traceypooh/blogtini + # github.com:traceypooh/blogtini + NAME=$(git config remote.origin.url |tr : / |rev |cut -d/ -f2 |rev) + REPO=$(git config remote.origin.url |tr : / |rev |cut -d/ -f1 |rev) + PREFIX=https://$NAME.github.io/$REPO +fi function sitemap() { OUTFILE=sitemap.xml