Skip to content

Commit f6d0cd0

Browse files
authored
Update pages.yml
1 parent 2396a1c commit f6d0cd0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/pages.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ jobs:
3737
if [ -f index.html ]; then
3838
echo "Keeping existing index.html (not regenerating)."
3939
elif [ -f README.md ]; then
40-
pandoc README.md -f markdown -t html -s --highlight-style=tango -o index.html --metadata title="$REPO_HTML_TITLE"
40+
pandoc README.md -f markdown -t html -s \
41+
--highlight-style=tango \
42+
-o index.html \
43+
--metadata title="$REPO_HTML_TITLE"
4144
else
4245
printf '%s\n' '<!doctype html><html><head><meta charset="utf-8"><title>Site</title></head><body>' '<h1>Site</h1>' '<p>No README.md found. Add one and push to regenerate this page.</p>' '</body></html>' > index.html
4346
fi
4447
45-
# Minimal CSS injection
48+
# Minimal CSS injection (escape </head> properly in awk regex)
4649
CSS_BLOCK='<style>body{font-family:Arial,Helvetica,sans-serif} pre code{display:block;padding:.75em;background:#f6f8fa;border-radius:6px;font-size:90%;overflow:auto}</style>'
4750
if grep -qi '</head>' index.html; then
48-
awk -v css="$CSS_BLOCK" 'BEGIN{IGNORECASE=1} { if (!done && match(tolower($0), /</head>/)) { sub(/</head>/, css"</head>"); done=1 } print }' index.html > index.html.tmp
51+
awk -v css="$CSS_BLOCK" 'BEGIN{IGNORECASE=1} { if (!done && match(tolower($0), /<\/head>/)) { sub(/<\/head>/, css"</head>"); done=1 } print }' index.html > index.html.tmp
4952
mv index.html.tmp index.html
5053
else
5154
TMP=$(mktemp)
@@ -71,7 +74,9 @@ jobs:
7174
echo "DEBUG: REPO_URL=$REPO_URL"
7275
echo "DEBUG: LAST_UPDATE=$LAST_UPDATE"
7376
74-
logins=$(curl -s -H "Authorization: Bearer $GH_TOKEN" "https://api.github.com/repos/$REPO/contributors?per_page=100&anon=false" | jq -r '.[] | select((.type // "") != "Bot") | select(.login != "ghost") | .login' | sort -fu)
77+
logins=$(curl -s -H "Authorization: Bearer $GH_TOKEN" \
78+
"https://api.github.com/repos/$REPO/contributors?per_page=100&anon=false" \
79+
| jq -r '.[] | select((.type // "") != "Bot") | select(.login != "ghost") | .login' | sort -fu)
7580
7681
names=""
7782
for u in $logins; do
@@ -140,3 +145,4 @@ jobs:
140145
steps:
141146
- id: deployment
142147
uses: actions/deploy-pages@v4
148+

0 commit comments

Comments
 (0)