Skip to content

Commit 6818874

Browse files
committed
init
0 parents  commit 6818874

80 files changed

Lines changed: 5177 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/lighthouse/config.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"ci": {
3+
"collect": {
4+
"numberOfRuns": 1,
5+
"settings": {
6+
"emulatedFormFactor": "desktop",
7+
"throttlingMethod": "devtools",
8+
"throttling": {
9+
"rttMs": 40,
10+
"throughputKbps": 10240,
11+
"cpuSlowdownMultiplier": 1
12+
}
13+
}
14+
},
15+
"assert": {
16+
"assertions": {
17+
"categories:performance": [
18+
"warn",
19+
{
20+
"minScore": 0.8
21+
}
22+
],
23+
"categories:accessibility": [
24+
"warn",
25+
{
26+
"minScore": 0.9
27+
}
28+
],
29+
"categories:best-practices": [
30+
"warn",
31+
{
32+
"minScore": 0.9
33+
}
34+
],
35+
"categories:seo": [
36+
"warn",
37+
{
38+
"minScore": 0.9
39+
}
40+
]
41+
}
42+
},
43+
"upload": {
44+
"target": "temporary-public-storage"
45+
}
46+
}
47+
}

.github/workflows/hugo.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2+
name: Deploy Hugo site to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- main
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
# Default to bash
26+
defaults:
27+
run:
28+
shell: bash
29+
30+
jobs:
31+
# Build job
32+
build:
33+
runs-on: ubuntu-latest
34+
env:
35+
HUGO_VERSION: 0.154.5
36+
HUGO_ENVIRONMENT: production
37+
steps:
38+
- name: Install Hugo CLI
39+
run: |
40+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
41+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
42+
- name: Install Dart Sass
43+
run: sudo snap install dart-sass
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
with:
47+
submodules: recursive
48+
fetch-depth: 0
49+
- name: Setup Pages
50+
id: pages
51+
uses: actions/configure-pages@v5
52+
- name: Install Node.js dependencies
53+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
54+
- name: Cache Restore
55+
id: cache-restore
56+
uses: actions/cache/restore@v4
57+
with:
58+
path: |
59+
${{ runner.temp }}/hugo_cache
60+
key: hugo-${{ github.run_id }}
61+
restore-keys:
62+
hugo-
63+
- name: Configure Git
64+
run: git config core.quotepath false
65+
- name: Build with Hugo
66+
run: |
67+
hugo \
68+
--gc \
69+
--minify \
70+
--cacheDir "${{ runner.temp }}/hugo_cache"
71+
- name: Cache Save
72+
id: cache-save
73+
uses: actions/cache/save@v4
74+
with:
75+
path: |
76+
${{ runner.temp }}/hugo_cache
77+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
78+
- name: Upload artifact
79+
uses: actions/upload-pages-artifact@v3
80+
with:
81+
path: ./public
82+
83+
# Deployment job
84+
deploy:
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
runs-on: ubuntu-latest
89+
needs: build
90+
steps:
91+
- name: Deploy to GitHub Pages
92+
id: deployment
93+
uses: actions/deploy-pages@v4

.github/workflows/lighthouse.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
lighthouse:
8+
runs-on: ubuntu-latest
9+
10+
outputs:
11+
perf: ${{ steps.scores.outputs.perf }}
12+
accessibility: ${{ steps.scores.outputs.accessibility }}
13+
best-practices: ${{ steps.scores.outputs.best-practices }}
14+
seo: ${{ steps.scores.outputs.seo }}
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Get deployment URL
21+
id: url
22+
run: |
23+
REPO_NAME="${{ github.repository }}"
24+
USER_NAME="${REPO_NAME%/*}"
25+
echo "url=https://${USER_NAME}.github.io/${REPO_NAME#*/}" >> $GITHUB_OUTPUT
26+
27+
- name: Run Lighthouse CI
28+
uses: treosh/lighthouse-ci-action@v11
29+
with:
30+
urls: |
31+
${{ steps.url.outputs.url }}
32+
uploadArtifacts: true
33+
temporaryPublicStorage: true
34+
configPath: ./.github/lighthouse/config.json
35+
36+
- name: Extract Lighthouse Scores
37+
id: scores
38+
run: |
39+
PERF=0
40+
ACCESS=0
41+
BEST=0
42+
SEO=0
43+
44+
if [ -f ".lighthouseci/assertion-results.json" ]; then
45+
if jq -e '.[0].audits.performance.score' .lighthouseci/assertion-results.json > /dev/null 2>&1; then
46+
PERF=$(jq -r '.[0].audits.performance.score // 0 | . * 100 | round' .lighthouseci/assertion-results.json)
47+
ACCESS=$(jq -r '.[0].audits.accessibility.score // 0 | . * 100 | round' .lighthouseci/assertion-results.json)
48+
BEST=$(jq -r '.[0].audits["best-practices"].score // 0 | . * 100 | round' .lighthouseci/assertion-results.json)
49+
SEO=$(jq -r '.[0].audits.seo.score // 0 | . * 100 | round' .lighthouseci/assertion-results.json)
50+
fi
51+
fi
52+
53+
if [ "$PERF" = "0" ] && ls .lighthouseci/lhr-*.json 1> /dev/null 2>&1; then
54+
LHR_FILE=$(ls .lighthouseci/lhr-*.json | head -1)
55+
if [ -f "$LHR_FILE" ]; then
56+
PERF=$(jq -r '.categories.performance.score // 0 | . * 100 | round' "$LHR_FILE")
57+
ACCESS=$(jq -r '.categories.accessibility.score // 0 | . * 100 | round' "$LHR_FILE")
58+
BEST=$(jq -r '.categories["best-practices"].score // 0 | . * 100 | round' "$LHR_FILE")
59+
SEO=$(jq -r '.categories.seo.score // 0 | . * 100 | round' "$LHR_FILE")
60+
fi
61+
fi
62+
63+
echo "perf=$PERF" >> $GITHUB_OUTPUT
64+
echo "accessibility=$ACCESS" >> $GITHUB_OUTPUT
65+
echo "best-practices=$BEST" >> $GITHUB_OUTPUT
66+
echo "seo=$SEO" >> $GITHUB_OUTPUT
67+
68+
update-readme:
69+
runs-on: ubuntu-latest
70+
needs: lighthouse
71+
permissions:
72+
contents: write
73+
74+
steps:
75+
- name: Checkout repository
76+
uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
80+
- name: Setup git config
81+
run: |
82+
git config user.name "github-actions[bot]"
83+
git config user.email "github-actions[bot]@users.noreply.github.com"
84+
85+
- name: Update README with Lighthouse scores
86+
run: |
87+
get_color() {
88+
SCORE=$1
89+
SCORE_CLEANED=$(echo "$SCORE" | sed 's/[^0-9]*//g')
90+
if [ -z "$SCORE_CLEANED" ] || [ "$SCORE_CLEANED" = "0" ]; then
91+
echo "lightgrey"
92+
elif [ "$SCORE_CLEANED" -ge 90 ]; then
93+
echo "brightgreen"
94+
elif [ "$SCORE_CLEANED" -ge 70 ]; then
95+
echo "green"
96+
elif [ "$SCORE_CLEANED" -ge 50 ]; then
97+
echo "yellow"
98+
else
99+
echo "red"
100+
fi
101+
}
102+
103+
declare -A scores=(
104+
["Performance"]="${{ needs.lighthouse.outputs.perf }}"
105+
["Accessibility"]="${{ needs.lighthouse.outputs.accessibility }}"
106+
["Best Practices"]="${{ needs.lighthouse.outputs.best-practices }}"
107+
["SEO"]="${{ needs.lighthouse.outputs.seo }}"
108+
)
109+
110+
for category in "${!scores[@]}"; do
111+
score="${scores[$category]}"
112+
color=$(get_color "$score")
113+
category_escaped=$(echo "$category" | sed 's/ /%20/g')
114+
sed -i -E "s|!\[$category\].*|![$category](https://img.shields.io/badge/$category_escaped-${score}%25-$color)|g" README.md
115+
done
116+
117+
sed -i "s/{PERF_SCORE}/${{ needs.lighthouse.outputs.perf }}/g" README.md
118+
sed -i "s/{ACCESS_SCORE}/${{ needs.lighthouse.outputs.accessibility }}/g" README.md
119+
sed -i "s/{BEST_SCORE}/${{ needs.lighthouse.outputs.best-practices }}/g" README.md
120+
sed -i "s/{SEO_SCORE}/${{ needs.lighthouse.outputs.seo }}/g" README.md
121+
122+
- name: Commit and push changes
123+
uses: stefanzweifel/git-auto-commit-action@v5
124+
with:
125+
commit_message: "docs: Update Lighthouse scores in README"
126+
file_pattern: README.md
127+
branch: ${{ github.ref }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
public/
3+
resources/
4+
.hugo_build.lock

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Jannik Menzel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)