Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09f0dc42e4
|
||
|
|
8e2303fcdf
|
||
|
|
4917abe9e6
|
||
|
|
b52629d1f6
|
||
|
|
b9159581f3
|
||
|
|
9e9163f01b
|
||
|
|
54a69b51ae
|
||
|
|
975ba4f312
|
||
|
|
6cd5ed61c4 | ||
|
|
1adca36802
|
||
|
|
3b1ef34bce
|
||
|
|
6b33be6956
|
||
|
|
f94a5cbe17
|
||
|
|
af31b6165c
|
||
|
|
946177a0b9
|
||
|
|
3361c9ee3d
|
||
|
|
ab802968ca
|
||
|
|
096026a964
|
||
|
|
6478741950
|
||
|
|
eb995c7b69
|
||
|
|
7207cfdbd0
|
||
|
|
36b2fc4188
|
||
|
|
62c4619c5e
|
||
|
|
f7beeb5e15
|
||
|
|
99ceb89e48
|
||
|
|
7217702068 | ||
|
|
11bf721f21 | ||
|
|
446c156338 | ||
|
|
909ea17f2f | ||
|
|
7a0df30ca1 | ||
|
|
a5f95bb6d7 | ||
|
|
f047389da9 | ||
|
|
b78f79e12e |
No files matched your search
@@ -0,0 +1,70 @@
|
|||||||
|
name: Build site
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- workflow_dispatch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
# NOTE: must match your act_runner labels (e.g. ubuntu-latest, ubuntu-24.04).
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Bootstrap pinned toolchain
|
||||||
|
run: ./scripts/bootstrap.sh
|
||||||
|
|
||||||
|
- name: Build site
|
||||||
|
run: ./scripts/calepin.sh compile site public
|
||||||
|
|
||||||
|
# The official upload-artifact@v4 refuses to run on Gitea (it detects a
|
||||||
|
# non-GitHub server and aborts with GHESNotSupportedError). v3 uses the
|
||||||
|
# artifact API that Gitea implements. On Gitea >= 1.22 with a current
|
||||||
|
# act_runner, christopherhx/gitea-upload-artifact@v4 is a drop-in
|
||||||
|
# replacement if you want the v4 API.
|
||||||
|
- name: Upload site artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: public
|
||||||
|
path: public/
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
# Publish only from main; move the gate to publish from another branch.
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
# Write access for the automatic Actions token to push the pages branch.
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
# NOTE: must match your act_runner labels (e.g. ubuntu-latest, ubuntu-24.04).
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download site artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: public
|
||||||
|
path: public
|
||||||
|
|
||||||
|
- name: Check artifact layout
|
||||||
|
run: test -f public/index.html
|
||||||
|
|
||||||
|
# Publishing interfaces with prod; it never runs under local act tests
|
||||||
|
# (act sets env.ACT, the Gitea runner does not). The force-push to the
|
||||||
|
# `pages` branch is what triggers the git-pages webhook.
|
||||||
|
- name: Publish to pages branch
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GITEA_TOKEN" ]; then
|
||||||
|
echo "::error::Missing GITEA_TOKEN (the automatic Actions token)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cd public
|
||||||
|
git init -q -b pages .
|
||||||
|
git config user.name "Yggdrasil CI"
|
||||||
|
git config user.email "ci@noreply.kb28.ch"
|
||||||
|
git add -A
|
||||||
|
git commit -q -m "Publish site from ${GITHUB_SHA}"
|
||||||
|
repo_host="${GITHUB_SERVER_URL#*://}"
|
||||||
|
repo_host="${repo_host%/}"
|
||||||
|
git push -q --force "https://${GITHUB_REPOSITORY_OWNER}:${GITEA_TOKEN}@${repo_host}/${GITHUB_REPOSITORY}.git" pages
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Generated site and pinned toolchain
|
||||||
|
public/
|
||||||
|
tools/
|
||||||
|
|
||||||
|
# Calepin build artifacts
|
||||||
|
.calepin/
|
||||||
|
.calepin-entry.*
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.idea/
|
||||||
|
.zed/
|
||||||
|
.vscode/
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Agent Rules for Yggdrasil Migration
|
||||||
|
|
||||||
|
* **Commit Policy**: Small conventional commits. One logical change per
|
||||||
|
commit, committed only once that step is verified and working. End every
|
||||||
|
commit message with a blank line followed by an
|
||||||
|
`Assisted-by: Delta:zai-glm-5.3` footer.
|
||||||
|
* **Layout**: Sources live in `site/` (`calepin.toml` + `.typ` pages),
|
||||||
|
generated output in `public/` (gitignored), pinned binaries in `tools/`
|
||||||
|
(gitignored), helper scripts in `scripts/`, and the old Docsify
|
||||||
|
documentation stays untouched in `legacy_docs/`.
|
||||||
|
* **Toolchain**: `calepin` (0.0.61) and `typst` (0.15.1) are pinned in
|
||||||
|
`scripts/bootstrap.sh` and downloaded into `tools/` with checksum
|
||||||
|
verification. The build must never depend on global installs. CI installs
|
||||||
|
the same pinned versions by calling the same scripts.
|
||||||
|
* **Verification**: Before committing, run a fresh cycle: `rm -rf tools`,
|
||||||
|
then `just clean`, then `just build` — the build must succeed with no
|
||||||
|
calepin on `PATH`. Verify the served site (`just preview`): home 200,
|
||||||
|
category page 200, sub-page 200, missing page shows the 404 page,
|
||||||
|
`sitemap.xml` present. After every test/clean cycle `git status` must stay
|
||||||
|
clean.
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Show the available recipes
|
||||||
|
default:
|
||||||
|
@just --list
|
||||||
|
|
||||||
|
# Bootstrap the pinned calepin + typst binaries into tools/
|
||||||
|
tools:
|
||||||
|
./scripts/bootstrap.sh
|
||||||
|
|
||||||
|
# Compile the site into public/
|
||||||
|
build: tools
|
||||||
|
./scripts/calepin.sh compile site public
|
||||||
|
|
||||||
|
# Build, then serve the site locally
|
||||||
|
preview: build
|
||||||
|
./scripts/calepin.sh serve public
|
||||||
|
|
||||||
|
# Rebuild on change and serve the result
|
||||||
|
watch: tools
|
||||||
|
./scripts/calepin.sh watch site public --serve
|
||||||
|
|
||||||
|
# Remove generated output and build caches
|
||||||
|
clean:
|
||||||
|
./scripts/clean.sh
|
||||||
|
|
||||||
|
# Remove all EXIF metadata from a file
|
||||||
|
strip-exif file:
|
||||||
|
exiftool -all= -overwrite_original {{ quote(file) }}
|
||||||
|
|
||||||
|
# Run the CI workflow locally with act (requires act + docker)
|
||||||
|
ci:
|
||||||
|
act push -W .gitea/workflows/build.yml -j build --artifact-server-path /tmp/act-artifacts
|
||||||
@@ -1,33 +1,88 @@
|
|||||||
<header>
|
# Yggdrasil
|
||||||
<h1>Yggdrasil</h1>
|
|
||||||
</header>
|
|
||||||
Yggdrasil is a collections of notes around IT, OT and other geeks stuff
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
# [Bachelor in embedded system](/infotro/)
|
Personal knowledge base built as a static website with
|
||||||
Here notes I take during my bachelor in embedded systems
|
[Calepin](https://vincentarelbundock.github.io/calepin/), a Typst-based static
|
||||||
|
site generator.
|
||||||
|
|
||||||
Mainly some topics:
|
## Layout
|
||||||
- [PTR - Programmation Temps Réel](/infotro/PTR/)
|
|
||||||
- [SDi - Système Distribué](/infotro/SDi/)
|
|
||||||
- [Eln - Électronique](/infotro/Eln/)
|
|
||||||
- [SEm - Systèmes Embarqué](/infotro/SEm/)
|
|
||||||
|
|
||||||
# [Master of science in engineering in embedded system](/MSE/)
|
- `site/` — website sources: `calepin.toml` + `.typ` pages
|
||||||
Here note I take during my Master of science un engineering with embedded system as orientation
|
- `site/themes/yggdrasil/` — local theme extending the bundled `calepin` theme (scoped sidebars, academic-styled landing)
|
||||||
|
- `public/` — generated site (gitignored)
|
||||||
|
- `tools/` — pinned `calepin` and `typst` binaries (gitignored, downloaded on demand)
|
||||||
|
- `scripts/` — helper scripts used by the Justfile and CI
|
||||||
|
- `legacy_docs/` — the old Docsify documentation, kept unmodified for reference
|
||||||
|
|
||||||
Mainly some topics:
|
## Quick start
|
||||||
- [SRE - Software Reverse Engineering](/MSE/SRE/)
|
|
||||||
|
|
||||||
# [Embedded Systems](/Embed/)
|
`just` is the only prerequisite — the toolchain is downloaded and
|
||||||
Here some note specific about some Embedded System
|
checksum-verified into `tools/` on first use (no global installs, no cargo):
|
||||||
- [STM32](/Embed/STM32/)
|
|
||||||
- [nRF](/Embed/nRF/)
|
|
||||||
|
|
||||||
# [Working environment at HES-SO](/HES-SO/)
|
just # list recipes
|
||||||
Here some note about the working environment at HES-SO
|
just tools # download the pinned toolchain into tools/
|
||||||
|
just build # compile site/ into public/
|
||||||
|
just preview # build, then serve the site locally
|
||||||
|
just watch # rebuild on change and serve
|
||||||
|
just clean # remove public/ and build caches
|
||||||
|
just ci # run the CI workflow locally with act (needs act + docker)
|
||||||
|
|
||||||
- [OneDrive - Linux](/HES-SO/OneDrive.md)
|
## Adding a page
|
||||||
- [Teams - Linux](/HES-SO/Teams.md)
|
|
||||||
|
Create `site/<category>/<page>.typ`:
|
||||||
|
|
||||||
|
```typst
|
||||||
|
#set document(title: [Page title])
|
||||||
|
#metadata((title: "Page title", translation_key: "category-page")) <website-metadata>
|
||||||
|
|
||||||
|
#title()
|
||||||
|
|
||||||
|
= Page title
|
||||||
|
|
||||||
|
Content…
|
||||||
|
```
|
||||||
|
|
||||||
|
and reference it in `site/calepin.toml`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[[sidebar.section.item]]
|
||||||
|
target = "<category>/<page>.typ"
|
||||||
|
```
|
||||||
|
|
||||||
|
Sidebar labels come from the page's `#metadata(...)` line, not from the config.
|
||||||
|
|
||||||
|
Every page also renders a printable PDF twin (`pdf = true` in
|
||||||
|
`calepin.toml`, selectable in the page's view picker). Add `pdf: false` to a
|
||||||
|
page's `#metadata(...)` to skip its PDF, as `404.typ` does.
|
||||||
|
|
||||||
|
## Adding a category
|
||||||
|
|
||||||
|
1. Create `site/<category>/` with an `index.typ`, using
|
||||||
|
`#metadata((title: "Overview", ...))` for its sidebar label.
|
||||||
|
2. Add a `[[sidebar.section]]` named after the category in `calepin.toml`,
|
||||||
|
listing the index page and its sub-pages.
|
||||||
|
3. Add a `[[menus.main]]` entry with the category's `index.typ` as `target`
|
||||||
|
and the category name as `label` (e.g. `Home`, `IT`), so it appears in the
|
||||||
|
top navigation bar. The `label` is required here because the index page's
|
||||||
|
metadata title is `Overview`.
|
||||||
|
|
||||||
|
Pages inside a category show only that category's sidebar section — the
|
||||||
|
local theme (`site/themes/yggdrasil/partials/site-nav-sidebar.html`) filters
|
||||||
|
the sidebar to the section containing the current page. Pages outside every
|
||||||
|
category (landing page, `404`, standalone pages) fall back to the full
|
||||||
|
sidebar.
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
`just build` produces a fully static site in `public/`: HTML pages with
|
||||||
|
printable PDF twins, plus `sitemap.xml`, `robots.txt`, and `llms.txt`. The
|
||||||
|
Gitea Actions workflow in
|
||||||
|
`.gitea/workflows/build.yml` builds the site on every push with the same
|
||||||
|
pinned toolchain and uploads `public/` as an artifact.
|
||||||
|
|
||||||
|
Pushes to `main` are also published: the `deploy` job force-pushes `public/`
|
||||||
|
to the repo's `pages` branch using the automatic Actions token (no secrets to
|
||||||
|
configure). A Gitea webhook on the repo then notifies the self-hosted
|
||||||
|
[git-pages](https://codeberg.org/git-pages/git-pages) server, which clones
|
||||||
|
the `pages` branch and serves the site. The push step is gated with
|
||||||
|
`if: ${{ !env.ACT }}` so local `act` runs never publish, and
|
||||||
|
`workflow_dispatch` enables manual publishes from the Gitea UI.
|
||||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |