You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/pages.yml
+44-54Lines changed: 44 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ on:
6
6
workflow_dispatch:
7
7
8
8
permissions:
9
-
contents: read
9
+
contents: write
10
10
pages: write
11
11
id-token: write
12
12
@@ -28,54 +28,66 @@ jobs:
28
28
sudo apt-get update
29
29
sudo apt-get install -y pandoc jq
30
30
31
-
# Prefer an existing docs/index.html; only generate from README if missing.
31
+
- id: ensure_license
32
+
name: Ensure MIT License exists (and mark if created)
33
+
run: |
34
+
if [ ! -f LICENSE ]; then
35
+
YEAR=$(date +%Y)
36
+
printf '%s\n' "MIT License" "" "Copyright (c) $YEAR Steph Buongiorno" "" "Permission is hereby granted, free of charge, to any person obtaining a copy" "of this software and associated documentation files (the \"Software\"), to deal" "in the Software without restriction, including without limitation the rights" "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" "copies of the Software, and to permit persons to whom the Software is" "furnished to do so, subject to the following conditions:" "" "The above copyright notice and this permission notice shall be included in all" "copies or substantial portions of the Software." "" "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" "SOFTWARE." > LICENSE
'<p>No README.md found. Add one and push to regenerate this page.</p>' \
53
-
'</body></html>' \
54
-
> docs/index.html
70
+
echo "No index.html or README.md found; writing minimal page."
71
+
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
55
72
GENERATED=1
56
73
fi
57
74
58
-
# Ensure Arial font is applied, even on a custom index.html
59
-
if grep -qi '</head>' docs/index.html; then
60
-
sed -i 's|</head>|<style>body{font-family:Arial, Helvetica, sans-serif;} h1,h2,h3,h4,h5,h6{font-family:Arial, Helvetica, sans-serif;}</style></head>|' docs/index.html
75
+
# Inject GitHub-like CSS for code blocks + base font without sed (avoid escaping issues)
76
+
CSS_BLOCK='<style>body{font-family:Arial,Helvetica,sans-serif} h1,h2,h3,h4,h5,h6{font-family:Arial,Helvetica,sans-serif} pre code{display:block;padding:.75em;background:#f6f8fa;border-radius:6px;font-size:90%;overflow:auto} code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace}</style>'
0 commit comments