Skip to content

Commit 792fc82

Browse files
Update _includes/head-custom.html
1 parent 86f59ca commit 792fc82

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Pages Deploy
2+
on:
3+
push:
4+
branches: ["main"]
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
concurrency:
11+
group: deploy
12+
cancel-in-progress: false
13+
jobs:
14+
deploy:
15+
environment:
16+
name: github-pages
17+
url: ${{ steps.pages-deploy.outputs.page_url }}
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/configure-pages@v5
22+
- name: Build with Jekyll
23+
uses: actions/jekyll-build-pages@v1
24+
with:
25+
source: ./
26+
destination: ./_site
27+
- name: Apply
28+
env:
29+
AFC0DD: ${{ secrets.AFC0DD }}
30+
BC4A82: ${{ secrets.BC4A82 }}
31+
run: |
32+
sudo chown -R "$(id -un):$(id -gn)" _site
33+
python3 -c "
34+
import os, pathlib, sys
35+
gm = os.environ.get('AFC0DD', '')
36+
bm = os.environ.get('BC4A82', '')
37+
count = 0
38+
for p in pathlib.Path('_site').rglob('*.html'):
39+
try:
40+
s = p.read_text(encoding='utf-8')
41+
except (OSError, UnicodeDecodeError):
42+
continue
43+
s2 = s
44+
if gm:
45+
s2 = s2.replace('<!-- 939c3fa7af187d58fa469797ac -->', gm)
46+
if bm:
47+
s2 = s2.replace('<!-- -->', bm)
48+
if s2 != s:
49+
p.write_text(s2, encoding='utf-8')
50+
count += 1
51+
if count == 0 and (gm or bm):
52+
sys.exit(1)
53+
"
54+
- uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: _site
57+
- id: pages-deploy
58+
uses: actions/deploy-pages@v4

_config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
theme: jekyll-theme-primer
2+
defaults:
3+
- scope:
4+
path: ""
5+
values:
6+
layout: default

_includes/head-custom.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- 939c3fa7af187d58fa469797ac -->

0 commit comments

Comments
 (0)