Skip to content

Commit 4fbcf38

Browse files
authored
Declutter, ORD & Matomo Stats (#21)
* refactor(scripts): split HEI cross-check workflow Keep the registry validation logic easier to maintain and test without changing the CLI entry point. Exclude the Wikidata SPARQL endpoint from automated link checks because it returns transient gateway errors. * refactor(dashboards): extract shared markup helpers Reduce repeated institution-type, table wrapper, and download markup across the dashboard pages while keeping the rendered output unchanged. * build(posters): share docposter extension assets Keep poster extension resources in one project-level location so updates do not need to be copied into each poster directory. * chore(dev): add Python quality hooks Run formatting, linting, and type checks before commit so Python changes are validated with the same toolchain used in CI. * fix(scripts): tolerate missing OpenAlex ids Return early when a row has no primary OpenAlex identifier so the HEI cross-check helper stays type-safe under the stricter pre-commit checks. * feat(dashboards): add Matomo usage snapshot pipeline Capture build-time Matomo reporting data in a checked-in snapshot so Quarto can publish historic usage without any client-side credentials. * feat(dashboards): add site usage dashboard Publish the most useful Matomo metrics directly on the site so readers can inspect lifetime and month-by-month usage without leaving the NAIF website. * ci: streamline validation and release builds Keep deployment and release artifacts aligned with the local validation flow while refreshing the Matomo usage snapshot during automated builds. * fix(dashboards): stabilise site usage overview presentation Keep the overview cards readable inside the dashboard tab layout and add the missing listing screenshot and attribution for the site usage page. * chore(dashboards): refresh Matomo usage snapshot Populate the site usage dashboard with the latest Matomo export so the published overview reflects the current reporting window totals, traffic sources, and top pages. * fix(dashboards): harden Matomo usage helpers * fix(dashboards): update FHNW name for consistency in data representation * feat(events): add event details for the European Commission workshop on research access and reuse * fix(events): update registration information for past event to indicate it has taken place * chore: clean up code structure and remove unused code blocks --------- Co-authored-by: Moritz Mähr <14755525+maehr@users.noreply.github.com>
1 parent 49a524d commit 4fbcf38

112 files changed

Lines changed: 3314 additions & 4649 deletions

File tree

Some content is hidden

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

.github/workflows/changelog.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v5
11+
uses: actions/checkout@v6
1212
with:
1313
fetch-depth: 0
1414

.github/workflows/link-check.yml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@v6
2020

2121
- name: Restore lychee cache
2222
id: restore-cache
23-
uses: actions/cache/restore@v4
23+
uses: actions/cache/restore@v5
2424
with:
2525
path: .lycheecache
2626
key: cache-lychee-${{ github.ref }}-${{ hashFiles('.lycheerc.toml') }}
@@ -36,33 +36,8 @@ jobs:
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838

39-
- name: Set up Python
40-
uses: actions/setup-python@v6
41-
with:
42-
python-version: "3.14"
43-
44-
- name: Install uv
45-
uses: astral-sh/setup-uv@v6
46-
47-
- name: Sync Python environment
48-
run: uv sync
49-
50-
- name: Set up Quarto
51-
uses: quarto-dev/quarto-actions/setup@v2
52-
53-
- name: Render Quarto project
54-
run: uv run quarto render
55-
56-
- name: Rendered HTML link checker
57-
uses: lycheeverse/lychee-action@v2
58-
with:
59-
args: >
60-
--offline --config .lycheerc.toml --root-dir ${{ github.workspace }}/_site
61-
'./_site/**/*.html'
62-
fail: true
63-
6439
- name: Save lychee cache
65-
uses: actions/cache/save@v4
40+
uses: actions/cache/save@v5
6641
if: always()
6742
with:
6843
path: .lycheecache

.github/workflows/quarto-publish.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Check out repository
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626

2727
- name: Set up Node.js
28-
uses: actions/setup-node@v5
28+
uses: actions/setup-node@v6
2929
with:
3030
node-version: "24"
3131
cache: "npm"
@@ -42,10 +42,10 @@ jobs:
4242
needs: lint
4343
steps:
4444
- name: Check out repository
45-
uses: actions/checkout@v5
45+
uses: actions/checkout@v6
4646

4747
- name: Set up Node.js
48-
uses: actions/setup-node@v5
48+
uses: actions/setup-node@v6
4949
with:
5050
node-version: "24"
5151
cache: "npm"
@@ -59,7 +59,7 @@ jobs:
5959
python-version: "3.14"
6060

6161
- name: Install uv
62-
uses: astral-sh/setup-uv@v6
62+
uses: astral-sh/setup-uv@v8
6363

6464
- name: Set up R
6565
uses: r-lib/actions/setup-r@v2
@@ -69,7 +69,7 @@ jobs:
6969

7070
- name: Set up Chrome
7171
id: setup-chrome
72-
uses: browser-actions/setup-chrome@v1
72+
uses: browser-actions/setup-chrome@v2
7373

7474
- name: Expose Chrome as google-chrome
7575
run: sudo ln -s "${{ steps.setup-chrome.outputs.chrome-path }}" /usr/local/bin/google-chrome
@@ -80,20 +80,34 @@ jobs:
8080
- name: Set up Quarto
8181
uses: quarto-dev/quarto-actions/setup@v2
8282

83-
- name: Render Quarto project
84-
run: uv run quarto render
83+
- name: Install lychee
84+
uses: taiki-e/install-action@v2
85+
with:
86+
tool: lychee
87+
88+
- name: Fetch Matomo usage snapshot
89+
env:
90+
MATOMO_TOKEN_AUTH: ${{ secrets.MATOMO_TOKEN_AUTH }}
91+
MATOMO_BASE_URL: ${{ vars.MATOMO_BASE_URL }}
92+
MATOMO_SITE_ID: ${{ vars.MATOMO_SITE_ID }}
93+
MATOMO_PUBLIC_SITE_URL: ${{ vars.MATOMO_PUBLIC_SITE_URL }}
94+
MATOMO_REPORT_START_DATE: ${{ vars.MATOMO_REPORT_START_DATE }}
95+
run: uv run python scripts/fetch_matomo_usage.py
96+
97+
- name: Run validation suite
98+
run: npm run validate
8599

86100
- name: JamPack optimization
87-
run: npx @divriots/jampack ./_site
101+
run: npm run jampack
88102

89103
- name: Upload built site artifact
90-
uses: actions/upload-artifact@v4
104+
uses: actions/upload-artifact@v7
91105
with:
92106
name: built-site
93107
path: _site
94108

95109
- name: Upload Pages artifact
96-
uses: actions/upload-pages-artifact@v4
110+
uses: actions/upload-pages-artifact@v5
97111
with:
98112
path: _site
99113

@@ -108,4 +122,4 @@ jobs:
108122
steps:
109123
- name: Deploy to GitHub Pages
110124
id: deployment
111-
uses: actions/deploy-pages@v4
125+
uses: actions/deploy-pages@v5

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Attach Rendered Site to Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-and-attach:
12+
name: Build site and upload release asset
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v6
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v6
20+
with:
21+
node-version: "24"
22+
cache: "npm"
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v6
29+
with:
30+
python-version: "3.14"
31+
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v8
34+
35+
- name: Set up R
36+
uses: r-lib/actions/setup-r@v2
37+
38+
- name: Install R dependencies
39+
run: Rscript -e 'install.packages("processx")'
40+
41+
- name: Set up Chrome
42+
id: setup-chrome
43+
uses: browser-actions/setup-chrome@v2
44+
45+
- name: Expose Chrome as google-chrome
46+
run: sudo ln -s "${{ steps.setup-chrome.outputs.chrome-path }}" /usr/local/bin/google-chrome
47+
48+
- name: Sync Python environment
49+
run: uv sync
50+
51+
- name: Set up Quarto
52+
uses: quarto-dev/quarto-actions/setup@v2
53+
54+
- name: Fetch Matomo usage snapshot
55+
env:
56+
MATOMO_TOKEN_AUTH: ${{ secrets.MATOMO_TOKEN_AUTH }}
57+
MATOMO_BASE_URL: ${{ vars.MATOMO_BASE_URL }}
58+
MATOMO_SITE_ID: ${{ vars.MATOMO_SITE_ID }}
59+
MATOMO_PUBLIC_SITE_URL: ${{ vars.MATOMO_PUBLIC_SITE_URL }}
60+
MATOMO_REPORT_START_DATE: ${{ vars.MATOMO_REPORT_START_DATE }}
61+
run: uv run python scripts/fetch_matomo_usage.py
62+
63+
- name: Build release archive
64+
run:
65+
npm run site:build && npm run site:archive -- --tag "${{ github.event.release.tag_name }}"
66+
67+
- name: Upload release asset
68+
uses: softprops/action-gh-release@v3
69+
with:
70+
files: release-artifacts/site-${{ github.event.release.tag_name }}.zip

.lycheerc.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ exclude = [
1818
"https://epfl.zoom.us/meeting/register/",
1919
# Python f-string URL templates in dashboard code (contain {identifier} placeholders)
2020
"https://www.wikidata.org/wiki/",
21+
# Wikidata SPARQL intermittently returns 502/504 during automated checks
22+
"https://query.wikidata.org/sparql",
2123
"https://api.crossref.org/funders/",
2224
"https://www.geonames.org/",
2325
"https://isni.org/isni/",

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ repos:
66
entry: npm run check
77
language: system
88
stages: [pre-commit]
9+
- id: ruff-format
10+
name: Ruff format
11+
entry: uv run ruff format
12+
language: system
13+
types: [python]
14+
stages: [pre-commit]
15+
- id: ruff-check
16+
name: Ruff lint
17+
entry: uv run ruff check
18+
language: system
19+
types: [python]
20+
stages: [pre-commit]
21+
- id: ty-check
22+
name: Ty check
23+
entry: uv run ty check
24+
language: system
25+
types: [python]
26+
pass_filenames: false
27+
stages: [pre-commit]
928
- id: lychee-check
1029
name: Lychee link check
1130
entry: npm run lychee-check

CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ Thanks for considering a contribution.
1414
3. Run:
1515

1616
```bash
17-
npm install
18-
uv sync
19-
npm run format
20-
uv run quarto render
17+
npm install
18+
uv sync
19+
npm run validate
2120
```
2221

2322
4. Open a pull request.
2423

24+
For tagged releases, also run `npm run release:prepare -- --tag vX.Y.Z` and commit the generated
25+
archive before publishing the release so Zenodo captures the rendered site snapshot.
26+
2527
## Content contributions
2628

2729
- Blog entries must follow the folder-per-entry structure described in `AGENTS.md`.

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This repository contains the source for the NAIF project website, built with
2222
- Node.js (for formatting Markdown with Prettier)
2323
- Python 3.14
2424
- uv
25+
- Lychee (for local link checks in `npm run validate`)
2526

2627
### Install
2728

@@ -30,6 +31,8 @@ npm install
3031
uv sync
3132
```
3233

34+
The Git hooks managed by `prek` are installed automatically via npm's `prepare` script.
35+
3336
### Format and build
3437

3538
```bash
@@ -57,12 +60,32 @@ Output file:
5760

5861
### Validate before opening a PR
5962

60-
Run all checks (formatting, linting, type checking, tests, render) in one go:
63+
Run all checks (formatting, linting, type checking, tests, render, rendered link checks) in one go:
6164

6265
```bash
6366
npm run validate
6467
```
6568

69+
If `lychee` is not available locally yet:
70+
71+
- macOS: `brew install lychee`
72+
- Other platforms: see https://lychee.cli.rs/
73+
74+
GitHub Actions runs the same validation suite before building and deploying the site.
75+
76+
### Prepare a release archive for Zenodo
77+
78+
Create a release-ready snapshot of the rendered site and stage it for commit before tagging a
79+
release:
80+
81+
```bash
82+
npm run release:prepare -- --tag v1.0.0
83+
```
84+
85+
This creates `release-artifacts/site-v1.0.0.zip` and stages it for commit. Commit the archive before
86+
publishing the GitHub release so the tagged repository snapshot contains the rendered site that
87+
Zenodo will archive.
88+
6689
### npm scripts reference
6790

6891
#### Quarto
@@ -74,6 +97,7 @@ npm run validate
7497
| `npm run preview` | `uv run quarto preview` | Local dev server with live reload |
7598
| `npm run preview:fork` | `uv run quarto preview --profile fork` | Preview locally with fork-specific URLs |
7699
| `npm run docx` | `uv run quarto render --profile docx` | Export site to a single DOCX |
100+
| `npm run site:build` | `render` + `jampack` | Build the optimised release site |
77101

78102
#### Code quality
79103

@@ -98,8 +122,10 @@ npm run validate
98122
| ------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------- |
99123
| `npm run sync` | `uv sync` | Install/sync Python dependencies |
100124
| `npm run validate` | check + lint + typecheck + test + render + lychee-check:rendered | Full pre-PR validation |
101-
| `npm run deploy` | render + jampack + publish | Build, optimise, and deploy to GitHub Pages |
125+
| `npm run deploy` | site:build + publish | Build, optimise, and deploy to GitHub Pages |
102126
| `npm run publish:fork` | `uv run quarto publish gh-pages --no-render --profile fork` | Publish a fork build to the fork's GitHub Pages site |
127+
| `npm run site:archive` | `uv run python scripts/release_site_archive.py` | Create a versioned ZIP of the rendered site |
128+
| `npm run release:prepare` | site:build + site:archive --stage | Build and stage the Zenodo-ready release archive |
103129
| `npm run changelog` | `git-cliff` | Generate CHANGELOG from commits |
104130
| `npm run commit` | `cz` | Commitizen guided commit |
105131
| `npm run lychee-check` | `lychee` | Check for broken links in source `.md` and `.qmd` files |

posters/2026-01-29-On-the-Current-and-Future-Uses-of-QSI/_extensions/bbucior/docposter/External/Monda-Bold.ttf renamed to _extensions/bbucior/docposter/External/Monda-Bold.ttf

File renamed without changes.

posters/2026-01-29-On-the-Current-and-Future-Uses-of-QSI/_extensions/bbucior/docposter/External/Monda-OFL.txt renamed to _extensions/bbucior/docposter/External/Monda-OFL.txt

File renamed without changes.

0 commit comments

Comments
 (0)