diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 594baad..5e3f868 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -122,19 +122,16 @@ jobs: CHECKSUM=$(sha256sum kewt-binary | awk '{print $1}') rm -f kewt-binary + git clone https://x-access-token:${{ secrets.GH_RELEASE_TOKEN }}@github.com/n0va-bot/homebrew-tap.git brew-work || true mkdir -p brew-work/Formula sed -e "s/VERSION_PLACEHOLDER/${VERSION}/g" \ -e "s/SHA256SUM_PLACEHOLDER/${CHECKSUM}/g" \ packaging/homebrew/kewt.rb.template > brew-work/Formula/kewt.rb cd brew-work - git init - git remote add origin https://x-access-token:${{ secrets.GH_RELEASE_TOKEN }}@github.com/n0va-bot/homebrew-tap.git - git fetch origin main || true - git checkout main 2>/dev/null || git checkout --orphan main - + [ -d .git ] || { git init && git checkout --orphan main && git remote add origin https://x-access-token:${{ secrets.GH_RELEASE_TOKEN }}@github.com/n0va-bot/homebrew-tap.git; } git add Formula/kewt.rb git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" git commit -m "Update kewt to ${TAG}" || echo "No changes to commit" - git push origin main + git push -u origin main diff --git a/kewt.sh b/kewt.sh index 916e539..f080d7b 100755 --- a/kewt.sh +++ b/kewt.sh @@ -693,7 +693,7 @@ render_markdown() { if [ "$rel_dir_of_file" = "$posts_dir" ]; then temp_post_with_backlink="$KEWT_TMPDIR/post_with_backlink.md" printf "[< Back](index.html)\n\n" > "$temp_post_with_backlink" - cat "$file" >> "$temp_post_with_backlink" + awk -f "$awk_dir/frontmatter.awk" "$file" >> "$temp_post_with_backlink" content_file="$temp_post_with_backlink" fi fi @@ -743,7 +743,13 @@ render_markdown() { fi head_extra="" if [ -n "$favicon_src" ]; then - head_extra="" + if echo "$favicon_src" | grep -q "^http"; then + head_extra="" + elif echo "$favicon_src" | grep -q "^/"; then + head_extra="" + else + head_extra="" + fi fi parse_frontmatter "$file"