Compare commits

..
13 Commits
Author SHA1 Message Date
Noel Sabia 435be63ae0 fix(ci): harden the release publish workflow after the PR review
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / AI code review (opencode) (pull_request) Successful in 48s
PR Check / Lint + typecheck (pull_request) Successful in 1m5s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 8s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
Applied the findings that held up against the code:
- strict vMAJOR.MINOR.PATCH guard; v[0-9]* accepted v1, v1-foo and
  prereleases, all valid registry tags
- latest now follows the newest release, so replaying an older tag cannot
  drag it backwards; skipped with a warning if the tag list is unavailable
- smoke test starts the built image and requires 2xx on / before pushing
- timeout-minutes: 20 on the job, so a hung build cannot hold the
  capacity-1 runner indefinitely
- the decision doc records the socket's blast radius: root-equivalent,
  runner-wide, only on a label PR jobs cannot use

Rejected with evidence: the .dockerignore leak (.env*, *.pem, .git are
excluded) and the Docker client/daemon API mismatch (20.10.24 client
against a 29.9.2 daemon builds over the socket).
2026-10-24 19:15:55 +02:00
Noel Sabia f3d3e196d0 Merge remote-tracking branch 'origin/main' into feat/registry
# Conflicts:
#	OKF_Nuxt/log.md
2026-10-24 19:13:41 +02:00
Noel ce941cad2d Merge pull request 'feat(i18n): add five locales and a header language switcher' (#17) from feat/language_support into main
release-please / release-please (push) Successful in 8s
Reviewed-on: #17
2026-10-23 20:40:17 +00:00
Noel Sabia e4b30ad944 fix(i18n): keep root links in the active locale and fix switcher a11y
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m7s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 55s
AppNav, AppLogo and AppBottomNav used NuxtLink to "/", which resolves to the English root under prefix_except_default; they now use NuxtLinkLocale and drop the hardcoded aria-current. Bottom-nav labels go through $t as well. The switcher's accessible name now contains the visible locale code, aria-haspopup is gone in favour of a plain disclosure with aria-controls, and Escape returns focus to the trigger.
2026-10-23 22:34:09 +02:00
Noel Sabia 078a49d14e Merge remote-tracking branch 'origin/main' into feat/language_support
PR Check / AI code review (opencode) (pull_request) Successful in 39s
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m8s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
Resolved: nuxt.config modules now carry @nuxt/icon and @nuxtjs/seo alongside @nuxtjs/i18n; package.json keeps both dependency sets; pnpm-lock.yaml regenerated. Also set i18n.baseUrl from site.config.mjs so sitemap alternates and future hreflang links are absolute.
2026-10-23 22:12:15 +02:00
Noel Sabia 93ab0c0d79 feat(i18n): add five locales and a header language switcher
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 58s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 6s
PR Check / AI code review (opencode) (pull_request) Successful in 42s
Locale files in i18n/locales for en, de, es, it and pl; English stays at / and the others are prefixed. One flag dropdown after the GitHub link on desktop, logo plus the language button on phones. Nav, quick links and footer strings go through $t, and the footer line drops "self-healing on purpose".
2026-10-23 22:00:34 +02:00
Noel 9b7222dd4d Merge pull request 'feat: rootpage' (#16) from feat/rootpage into main
release-please / release-please (push) Successful in 8s
Reviewed-on: #16
2026-10-23 19:53:14 +00:00
Noel Sabia b1a2eae48a chore: drop the unused public/_robots.txt
PR Check / Lint + typecheck (pull_request) Successful in 1m3s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Dockerfile lint (droast) (pull_request) Successful in 4s
PR Check / AI code review (opencode) (pull_request) Successful in 55s
@nuxtjs/seo writes robots.txt; the renamed copy was only reachable at
/_robots.txt and referenced nowhere.
2026-10-23 21:50:17 +02:00
Noel Sabia 2f9f236f13 fix(favicon): keep the ICO transparent when BACKGROUND is null
The documented null option fell through to opaque black: the BGRA writer
defaulted to #000000 and hardcoded alpha 0xff.
2026-10-23 21:50:17 +02:00
Noel Sabia ad4e8d7bd9 fix(ci): tell the reviewer the lockfile is excluded on purpose
The diff filter drops pnpm-lock.yaml to keep the patch small; the model read
that as an uncommitted lockfile and raised a BLOCKER on PR #16. Say so in the
prompt instead of widening the diff.
2026-10-23 21:50:17 +02:00
Noel Sabia 1c3503fed0 feat: pixel favicon and complete SEO metadata
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m6s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 7s
PR Check / AI code review (opencode) (pull_request) Successful in 1m11s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
- generate favicon.ico and favicon.svg from the header avatar; the sprite
  moves to app/utils/avatar.js so component and generators share one source
- register @nuxtjs/seo with site and Person schema.org data from
  site.config.mjs; canonical, robots, sitemap and llms.txt follow the routes
- title "Noel Sabia — <role>", summary_large_image, and no duplicate
  "| Noel Sabia" suffix from SEO Utils
- add a committed 1200x630 OG card generated by pnpm og-image; the dynamic
  OG renderer and skew protection stay off for the static deployment
- pin the Node version @nuxtjs/seo 6 requires and document the setup in the
  OKF bundle
2026-10-23 20:37:32 +02:00
Noel Sabia 24460083ff docs(okf): record the Nuxt Icon decision
- decisions/icons-via-nuxt-icon.md: local collection, mode svg,
  serverBundle collections empty, scanned client bundle; 3 icons, 1.23 kB
- linked from the bundle index and the decisions index, logged
2026-10-23 20:11:15 +02:00
Noel Sabia 3396c4949e feat(ui): mobile bottom nav on Nuxt Icon, footer hidden on phones
- AppBottomNav: fixed bar below md with Overview, Life Map and Dev View
- default.vue mounts it and carries pb-16 md:pb-0 so the footer stays clear
- AppFooter is hidden below md, where the bar takes over
- icons come from @nuxt/icon (mode svg, scanned client bundle) with the
  Material Symbols collection installed locally, replacing the webfont
- deletes the 3.9 MiB Material Symbols woff2 and its @font-face
2026-10-23 20:10:52 +02:00
38 changed files with 3508 additions and 176 deletions

No files matched your search

+5
View File
@@ -341,6 +341,11 @@ jobs:
The full PR diff is in the file .pr-review-diff.patch in the repo The full PR diff is in the file .pr-review-diff.patch in the repo
root. Read it first with your file tools. root. Read it first with your file tools.
pnpm-lock.yaml is deliberately excluded from that patch to keep it
small, not forgotten. It is committed in the PR, pnpm audit covers
the dependencies, and CI runs `pnpm install --frozen-lockfile`.
Do not report a missing lockfile or a frozen-install drift.
## Project context ## Project context
- Stack: Nuxt 4 (Vue 3, TypeScript) SSR web app in the repo root. - Stack: Nuxt 4 (Vue 3, TypeScript) SSR web app in the repo root.
Backend/API services are being added in Golang. Backend/API services are being added in Golang.
+92 -22
View File
@@ -26,6 +26,9 @@ jobs:
publish: publish:
name: Build and push image name: Build and push image
runs-on: ubuntu-latest runs-on: ubuntu-latest
# A hung build would hold the capacity-1 runner and, through it, every
# other job on this server. Gitea's instance default is not a contract.
timeout-minutes: 20
# Same base image as the other jobs. The build runs on the runner's # Same base image as the other jobs. The build runs on the runner's
# Docker daemon (not in a nested daemon), so this container only needs # Docker daemon (not in a nested daemon), so this container only needs
# the CLI - see OKF_Nuxt/decisions/registry-publishing.md. # the CLI - see OKF_Nuxt/decisions/registry-publishing.md.
@@ -47,6 +50,12 @@ jobs:
# An unreachable daemon means the runner was started without the # An unreachable daemon means the runner was started without the
# host socket mounted: set `docker_host: automount` in the # host socket mounted: set `docker_host: automount` in the
# act_runner config and restart the service. # act_runner config and restart the service.
#
# The socket is root-equivalent on the host, and automount is a
# runner-wide setting - it applies to every job on that runner,
# including PR jobs. Only enable it on a runner label that
# PR-triggered jobs cannot use; see the trust boundary in
# OKF_Nuxt/decisions/registry-publishing.md.
run: | run: |
echo "DOCKER_HOST=${DOCKER_HOST:-<unset - the default socket path>}" echo "DOCKER_HOST=${DOCKER_HOST:-<unset - the default socket path>}"
if ! docker info > /dev/null 2>&1; then if ! docker info > /dev/null 2>&1; then
@@ -60,32 +69,43 @@ jobs:
# GITHUB_REF_NAME is the tag on a tag push. The git fallback keeps # GITHUB_REF_NAME is the tag on a tag push. The git fallback keeps
# this working if a runner version does not set it. # this working if a runner version does not set it.
version="${GITHUB_REF_NAME:-$(git describe --tags --exact-match HEAD)}" version="${GITHUB_REF_NAME:-$(git describe --tags --exact-match HEAD)}"
case "$version" in # Strict semver, not a `v[0-9]*` prefix match: that would accept
v[0-9]*) ;; # `v1`, `v1-anything` and prereleases, all valid registry tags.
*) echo "::error::expected a vX.Y.Z tag, got '${version}'"; exit 1 ;; if ! printf '%s' "$version" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
esac echo "::error::expected a vMAJOR.MINOR.PATCH tag, got '${version}'"
exit 1
fi
sha="$(git rev-parse --short=12 HEAD)"
# `latest` follows the newest release, not the newest build. A
# re-run of an older tag (Gitea can replay any run) must not drag
# `latest` backwards, while a re-run of the newest tag may set it:
# that release had not produced an image yet.
# A tag comparison needs the other tags, which a depth-1 tag
# checkout does not have. If the fetch fails, skip `latest` and
# say so - a wrong tag is worse than a missing one.
if git fetch --tags --force --quiet origin 2>/dev/null; then
newest="$(git tag -l | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)"
if [ "$version" = "$newest" ]; then
latest=true
else
latest=false
echo "::warning::${version} is not the newest release (${newest}) - not moving :latest"
fi
else
latest=false
echo "::warning::could not list tags - not moving :latest"
fi
# Short SHA tag alongside the version: OKF_CV_Website/architecture/ # Short SHA tag alongside the version: OKF_CV_Website/architecture/
# delivery.md asks for SHA-tagged images so every deploy is # delivery.md asks for SHA-tagged images so every deploy is
# traceable to a commit even after a tag is moved. # traceable to a commit even after a tag is moved.
sha="$(git rev-parse --short=12 HEAD)"
{ {
echo "version=${version}" echo "version=${version}"
echo "sha=${sha}" echo "sha=${sha}"
echo "latest=${latest}"
} >> "$GITHUB_OUTPUT" } >> "$GITHUB_OUTPUT"
echo "Building ${version} from ${sha}" echo "Building ${version} from ${sha} (latest: ${latest})"
- name: Log in to the registry
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
# Missing secrets must fail loudly: an anonymous `docker push`
# would answer 401 with a message most people misread as a
# missing repository.
[ -n "$REGISTRY_USERNAME" ] || { echo "::error::secret REGISTRY_USERNAME is empty"; exit 1; }
[ -n "$REGISTRY_PASSWORD" ] || { echo "::error::secret REGISTRY_PASSWORD is empty"; exit 1; }
printf '%s' "$REGISTRY_PASSWORD" \
| docker login registry.noelsabia.dev -u "$REGISTRY_USERNAME" --password-stdin
- name: Build image - name: Build image
env: env:
@@ -101,17 +121,67 @@ jobs:
--label "org.opencontainers.image.revision=${SHA}" \ --label "org.opencontainers.image.revision=${SHA}" \
-t "${IMAGE}:${VERSION}" \ -t "${IMAGE}:${VERSION}" \
-t "${IMAGE}:sha-${SHA}" \ -t "${IMAGE}:sha-${SHA}" \
-t "${IMAGE}:latest" \
"${APP_DIR}" "${APP_DIR}"
- name: Smoke-test the image
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
# Start the real server inside the built image and require a 2xx
# from /. Cheaper than publishing a broken release, and the only
# step that proves the Nitro output actually runs. Done inside the
# container because the app's port is not reachable from this job
# container - the daemon publishes on the host, not here.
docker run --rm "${IMAGE}:${VERSION}" sh -c '
node .output/server/index.mjs &
server=$!
i=0
while [ "$i" -lt 30 ]; do
if node -e "fetch(\"http://127.0.0.1:3000/\").then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"; then
echo "server answered 2xx after ${i}s"
kill "$server"
exit 0
fi
i=$((i + 1))
sleep 1
done
echo "server did not answer 2xx within 30s"
kill "$server"
exit 1
'
- name: Log in to the registry
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
# Missing secrets must fail loudly: an anonymous `docker push`
# would answer 401 with a message most people misread as a
# missing repository.
[ -n "$REGISTRY_USERNAME" ] || { echo "::error::secret REGISTRY_USERNAME is empty"; exit 1; }
[ -n "$REGISTRY_PASSWORD" ] || { echo "::error::secret REGISTRY_PASSWORD is empty"; exit 1; }
printf '%s' "$REGISTRY_PASSWORD" \
| docker login registry.noelsabia.dev -u "$REGISTRY_USERNAME" --password-stdin
- name: Tag latest
if: steps.version.outputs.latest == 'true'
env:
VERSION: ${{ steps.version.outputs.version }}
run: docker tag "${IMAGE}:${VERSION}" "${IMAGE}:latest"
- name: Push image - name: Push image
env: env:
VERSION: ${{ steps.version.outputs.version }} VERSION: ${{ steps.version.outputs.version }}
SHA: ${{ steps.version.outputs.sha }} SHA: ${{ steps.version.outputs.sha }}
LATEST: ${{ steps.version.outputs.latest }}
run: | run: |
# Explicit per tag, not `--all-tags`: --all-tags would also push # Explicit per tag, not `--all-tags`: --all-tags would also push
# stale local tags left on the shared daemon by earlier runs. # stale local tags left on the shared daemon by earlier runs.
docker push "${IMAGE}:${VERSION}" docker push "${IMAGE}:${VERSION}"
docker push "${IMAGE}:sha-${SHA}" docker push "${IMAGE}:sha-${SHA}"
docker push "${IMAGE}:latest" if [ "$LATEST" = "true" ]; then
echo "Pushed ${IMAGE}:${VERSION}, :sha-${SHA}, :latest" docker push "${IMAGE}:latest"
echo "Pushed ${IMAGE}:${VERSION}, :sha-${SHA}, :latest"
else
echo "Pushed ${IMAGE}:${VERSION}, :sha-${SHA} (:latest untouched)"
fi
+76
View File
@@ -0,0 +1,76 @@
---
type: Decision
title: Icons via Nuxt Icon
description: Every icon comes from @nuxt/icon with the Material Symbols collection installed locally; the self-hosted icon webfont, its @font-face and its CSS class are gone.
tags: [decision, ui, icons, nuxt, payload]
status: stable
generated: { by: opencode-go/deepseek-v4.1-flash, at: 2026-10-23T00:00:00Z }
verified: { by: human:noel, at: 2026-10-23T00:00:00Z }
sources:
- id: config
resource: nuxt.config.ts
title: Icon module registration and options
- id: consumer
resource: app/components/AppBottomNav.vue
title: First and only icon consumer so far
- id: package
resource: package.json
title: "@nuxt/icon and @iconify-json/material-symbols"
---
# Decision
Icons come exclusively from `@nuxt/icon`. The icon set is Material Symbols,
installed as a local collection (`@iconify-json/material-symbols`), and names are
written in full inside components:
```vue
<Icon name="material-symbols:badge" aria-hidden="true" class="text-[22px]" />
```
The previously self-hosted Material Symbols webfont is deleted:
`public/fonts/material-symbols-outlined-var.woff2`, its `@font-face` in
`app/assets/css/main.css`, and the `.material-symbols-outlined` class.
# Why
* **One icon system.** The nav rendered webfont glyphs by text content while
everything else in the app is Tailwind utilities; a ligature typo silently
produced a blank box.
* **Payload.** The font was 3.9 MiB for three glyphs. The bundled icon data for
the same three is 1.23 kB.
* **Self-hosting.** The module's defaults are not local: `mode: "css"`, provider
`server`, `iconifyApiEndpoint: https://api.iconify.design` and
`fallbackToApi: true`. Without an installed collection the site would call a
third-party CDN at runtime, which is the same problem the self-hosted text
fonts were chosen to avoid.
# Configuration
| Option | Value | Effect |
|---|---|---|
| `mode` | `'svg'` | The icon is an inline `<svg>` in the SSR HTML, so it survives with JavaScript disabled. CSS mode would have fetched icon data on the client and painted after hydration. |
| `serverBundle` | `{ collections: [] }` | `'auto'` bundles every installed collection server-side; with only `material-symbols` installed that was an 8 MB `icons.mjs`. Empty means no server-side icon data at all. |
| `clientBundle` | `{ scan: true }` | Bundles only the icons named in source. The build reports `Nuxt Icon client bundle consist of 3 icons with 1.23KB(uncompressed) in size`. |
# Consequences
* Sizing is `text-[…]` on the `<svg>`: the component renders `width="1em"
height="1em"`, so font-size is the icon size.
* Adding another Material Symbols icon is a code change only — the scanner picks
the name up and the next build bundles it.
* A different icon set means `pnpm add @iconify-json/<set>` plus new names; no
other configuration changes.
* Decorative icons carry `aria-hidden="true"`, because every icon sits next to a
text label.
# Not verified
* That the bars look right at 22px on a real phone — checked in the SSR HTML and
the build output only.
# Revisit when
* A second icon set is wanted (two collections, two packages, no config change).
* Many icons push the client bundle up: the alternative is `mode: 'css'`, which
ships class names and fetches icon data once instead of inline SVG per icon.
+2
View File
@@ -12,3 +12,5 @@
* [Production image shape](production-image.md) - Multi-stage, digest-pinned, non-root runnable Node server; measured build and serve. * [Production image shape](production-image.md) - Multi-stage, digest-pinned, non-root runnable Node server; measured build and serve.
* [Repository and compose layout](repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`. * [Repository and compose layout](repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
* [Mockup layout](mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded. * [Mockup layout](mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
* [Icons via Nuxt Icon](icons-via-nuxt-icon.md) - Every icon comes from `@nuxt/icon` with the Material Symbols collection installed locally; the 3.9 MiB icon webfont is gone and three icons cost 1.23 kB.
* [SEO stack and site metadata](seo-and-metadata.md) - One `site.config.mjs` feeds canonical URLs, sitemap, robots, schema.org and the static OG card; the dynamic OG renderer and skew protection stay off.
+37 -1
View File
@@ -26,7 +26,7 @@ result to the own registry:
``` ```
registry.noelsabia.dev/cv_website/nuxt:v1.2.3 registry.noelsabia.dev/cv_website/nuxt:v1.2.3
registry.noelsabia.dev/cv_website/nuxt:sha-<12-char-sha> registry.noelsabia.dev/cv_website/nuxt:sha-<12-char-sha>
registry.noelsabia.dev/cv_website/nuxt:latest registry.noelsabia.dev/cv_website/nuxt:latest # newest release only
``` ```
**Trigger is the release tag, not the main push.** release-please creates **Trigger is the release tag, not the main push.** release-please creates
@@ -64,6 +64,27 @@ instead of a mid-build error. The alternative - a privileged `docker:dind`
sidecar - needs privileged mode and a second daemon per release; not worth sidecar - needs privileged mode and a second daemon per release; not worth
it on this server. it on this server.
## Trust boundary (the cost of the socket)
A mounted Docker socket is **root-equivalent on the host**: any job that
has it can run `docker run -v /:/host` and read or write anything, which on
this machine means Gitea's data, k3s, and the CV itself. `docker_host` is a
**runner-wide** setting, so enabling it gives the socket to every job on
that runner, including PR jobs whose code comes from a branch.
Therefore the rule: **the socket only ever goes on a runner label that
PR-triggered jobs do not use.** Two acceptable layouts:
* a second act_runner registration with `docker_host: automount` and a
distinct label (e.g. `publish`), used only by this workflow; or
* one runner, but this workflow moved to the dedicated label and
`pr-checker.yml` left on a label without the socket.
Not acceptable: adding `automount` to the single shared runner while
`pr-checker.yml` runs on it. If that is the only option, treat it as an
accepted risk and record it here - the trade is "PR code can become root on
the host" against "images can be built at all".
# Why `--platform linux/arm64` # Why `--platform linux/arm64`
The runner and the node are the same arm64 machine, so the build is native The runner and the node are the same arm64 machine, so the build is native
@@ -81,6 +102,15 @@ run.
Both are repo secrets. The login uses `--password-stdin` so the value never Both are repo secrets. The login uses `--password-stdin` so the value never
appears in the process list or the log. appears in the process list or the log.
# Guards in the workflow
| Guard | Why |
|---|---|
| Strict `^vMAJOR.MINOR.PATCH$` check | A `v[0-9]*` prefix match accepts `v1`, `v1-anything` and `v1.2.3-rc1`, all of which are valid registry tags and would publish silently |
| `latest` only when the built tag is the highest `vX.Y.Z` in the repository | Gitea can replay any run. Without the comparison, re-running `v1.2.0` after `v1.3.0` drags `latest` backwards. A re-run of the newest tag still moves it - that release had not produced an image yet. If the tag list cannot be fetched, `latest` is skipped with a warning rather than guessed |
| Smoke test before any push | The image is started and must answer 2xx on `/` from inside the container. Build success only proves the bundle compiled. Port publishing is not usable here: the daemon binds on the host, not in the job container |
| `timeout-minutes: 20` | A hung build would hold the capacity-1 runner and every job queued behind it |
# Costs and consequences # Costs and consequences
* **Registry storage grows** by one image per release in three tags. The * **Registry storage grows** by one image per release in three tags. The
@@ -101,10 +131,16 @@ appears in the process list or the log.
the workflow's first step answers this on the first release. the workflow's first step answers this on the first release.
* That the arm64 build succeeds: `Dockerfile` has been built on x86_64 * That the arm64 build succeeds: `Dockerfile` has been built on x86_64
only ([production image](production-image.md)). only ([production image](production-image.md)).
* That the smoke test passes on arm64. The same script was run against an
x86_64 build of the merged tree and answered 2xx; the arm64 run is the
first release.
* That `registry.noelsabia.dev` is reachable over HTTPS from the runner. * That `registry.noelsabia.dev` is reachable over HTTPS from the runner.
A plain-HTTP endpoint fails `docker login` with `server gave HTTP A plain-HTTP endpoint fails `docker login` with `server gave HTTP
response to HTTPS client` and needs `insecure-registries` on the daemon response to HTTPS client` and needs `insecure-registries` on the daemon
plus `registries.yaml` on k3s. plus `registries.yaml` on k3s.
* Whether Gitea runs a `pull_request` workflow from a fork without
maintainer approval on this instance. That answer decides how severe the
socket risk above really is.
# Revisit when # Revisit when
+98
View File
@@ -0,0 +1,98 @@
---
type: Decision
title: SEO stack and site metadata
description: @nuxtjs/seo owns canonical URLs, sitemap, robots, schema.org and social tags; metadata lives in one ESM file, the OG card is a committed PNG, and the dynamic OG renderer and skew protection stay off.
tags: [decision, seo, metadata, nuxt, static]
status: stable
generated: { by: opencode-go/deepseek-v4.1-flash, at: 2026-10-23T00:00:00Z }
verified: { by: human:noel, at: 2026-10-23T00:00:00Z }
sources:
- id: config
resource: nuxt.config.ts
title: site, schemaOrg, ogImage and skewProtection options
- id: metadata
resource: site.config.mjs
title: Single source for URL, name, role, description, locale, email, GitHub
- id: page
resource: app/pages/index.vue
title: Page title and Twitter card type
- id: generator
resource: scripts/generate-og-image.mjs
title: OG card generator
- id: package
resource: package.json
title: "@nuxtjs/seo, Node engines, og-image script"
---
# Decision
`@nuxtjs/seo` 6.0.1 is registered as one module; it brings sitemap, robots,
OG Image, schema.org, link checker, SEO Utils, site config, AI Ready and skew
protection. The site's own values live in `site.config.mjs`:
```js
export const SITE = {
url: 'https://noelsabia.dev',
name: 'Noel Sabia',
role: 'Programmer, AI Assisted Coder, Arch user',
description: '…',
locale: 'en',
email: 'noel@noelsabia.dev',
github: 'https://github.com/NoelSabia',
}
```
`nuxt.config.ts` maps that into `site` (URL, name, description, locale) and
`schemaOrg.identity` (`Person`, with `jobTitle`, `email`, `sameAs: [GitHub]`).
`app/pages/index.vue` sets the title to `<name> — <role>` and
`twitter:card: summary_large_image`; `useHead({ titleTemplate: '%s' })` stops
SEO Utils from appending `| Noel Sabia` to the title it already contains.
# Why a static OG card
`public/og-image.png` (1200×630) is generated from the same pixel avatar as the
favicon, plus the name and role. It is committed. `ogImage: false` disables the
dynamic module, so no Takumi/Satori renderer, native binary or runtime image
route is added; SEO Utils still emits `og:image`, `twitter:image`, their
`width`/`height`/`type` tags, and the alt text from `og-image.alt.txt`.
Regenerate with `pnpm og-image`. That script needs `woff2_decompress` and
`rsvg-convert` on the machine because librsvg cannot read the self-hosted woff2
files; the output is committed, so builds and deploys need neither tool.
# Other settings
| Option | Value | Reason |
|---|---|---|
| `skewProtection` | `false` | The site ships as static files inside the gateway image; there are no old chunks to keep and the CI starts from a clean checkout, so the cache would be empty. Avoids an extra service worker. |
| `engines.node` | `^22.22.3 \|\| ^24.15.0 \|\| >=26.0.0` | `@nuxtjs/seo` 6 refuses to boot on older Node. Docker uses `node:26-slim`; CI uses `node:22-bookworm`, which tracks the latest 22.x. |
Robots, sitemap and AI Ready keep their defaults: `robots.txt` allows all
crawlers and appends `Sitemap: https://noelsabia.dev/sitemap.xml`;
`sitemap.xml` is generated from the routes (only `/` today); `/llms.txt`,
`/llms-full.txt` and Markdown versions of pages are produced by AI Ready.
# Consequences
* `site.url` is the canonical origin. Every environment serves the production
URLs; a staging deploy must set `NUXT_SITE_ENV=staging` so robots and the
`X-Robots-Tag` header block indexing.
* Adding a page needs no SEO config: canonical, OG basics and sitemap entry
follow the route. Give it a title with `useSeoMeta` and the default
`| Noel Sabia` suffix returns unless it sets `titleTemplate` too.
* `nuxt generate` writes `robots.txt`, `sitemap.xml`, `llms.txt`, the Markdown
pages and the static OG card into `.output/public`.
# Not verified
* How the card looks in a real LinkedIn, X or WhatsApp preview; the PNG was
checked locally at full size.
* Crawling in Google Search Console — the domain is not live yet.
# Revisit when
* There are several pages and one shared card is no longer enough: enable
Takumi with `npx nuxt-og-image enable takumi` and replace `ogImage: false`
with a template.
* German is actually translated: add `@nuxtjs/i18n` instead of listing `de` in
`defaultLocale`, which must stay a single language tag.
+6 -1
View File
@@ -22,7 +22,7 @@ config files — the configs say what, these documents say why.
* [Vulnerability audit policy](decisions/vulnerability-audit-policy.md) - Blocking audit; reviewed ignore-list for unfixable advisories in pnpm-workspace.yaml. * [Vulnerability audit policy](decisions/vulnerability-audit-policy.md) - Blocking audit; reviewed ignore-list for unfixable advisories in pnpm-workspace.yaml.
* [Release engineering](decisions/release-engineering.md) - release-please in manifest mode; conventional commits enforced at commit time. * [Release engineering](decisions/release-engineering.md) - release-please in manifest mode; conventional commits enforced at commit time.
* [Snyk paused and secrets policy](decisions/snyk-paused-and-secrets-policy.md) - Quota-paused job kept in place; `write:issue` scope required on every workflow token. * [Snyk paused and secrets policy](decisions/snyk-paused-and-secrets-policy.md) - Quota-paused job kept in place; `write:issue` scope required on every workflow token.
* [Publishing images to the own registry](decisions/registry-publishing.md) - A release tag builds the image and pushes it to registry.noelsabia.dev, with `docker_host: automount` on the runner. * [Publishing images to the own registry](decisions/registry-publishing.md) - A release tag builds the image and pushes it to registry.noelsabia.dev; the runner socket it needs is root-equivalent and belongs on a separate label.
## Docker and development environment ## Docker and development environment
@@ -33,6 +33,11 @@ config files — the configs say what, these documents say why.
* [Repository and compose layout](decisions/repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`. * [Repository and compose layout](decisions/repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
* [Mockup layout](decisions/mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded. * [Mockup layout](decisions/mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
## UI and icons (2026-10-23)
* [Icons via Nuxt Icon](decisions/icons-via-nuxt-icon.md) - Icons come only from `@nuxt/icon` with a locally installed Material Symbols collection; inline SVG for SSR, scanned client bundle, and no icon webfont.
* [SEO stack and site metadata](decisions/seo-and-metadata.md) - `@nuxtjs/seo` with one metadata file, a `Person` identity, a committed 1200x630 OG card, and no dynamic OG renderer or skew protection.
# The one-paragraph history # The one-paragraph history
The repository started as the Nuxt app shell. Docker development (dev The repository started as the Nuxt app shell. Docker development (dev
+22 -1
View File
@@ -2,7 +2,28 @@
## 2026-10-24 (release publishes an image) ## 2026-10-24 (release publishes an image)
* **Creation**: [publish-image.yml](../.gitea/workflows/publish-image.yml) - a `v*` tag push builds `Dockerfile` on the arm64 runner and pushes `registry.noelsabia.dev/cv_website/nuxt` as the version, `sha-<12>`, and `latest`. Main pushes deliberately do not build: the registry holds releases, not commits. The job uses the runner's own Docker daemon (client only in the `node:22-bookworm` container), so the act_runner needs `container.docker_host: automount`; the first step fails with that cause if it is missing. Repo secrets: `REGISTRY_USERNAME`, `REGISTRY_PASSWORD`. See [Publishing images to the own registry](decisions/registry-publishing.md). * **Creation**: [publish-image.yml](../.gitea/workflows/publish-image.yml) - a `vX.Y.Z` tag push builds `Dockerfile` on the arm64 runner and pushes `registry.noelsabia.dev/cv_website/nuxt` as the version and `sha-<12>`, plus `latest` when that tag is the newest release. Main pushes deliberately do not build: the registry holds releases, not commits. The job uses the runner's own Docker daemon (client only in the `node:22-bookworm` container), so the act_runner needs `container.docker_host: automount`; the first step fails with that cause if it is missing. That socket is root-equivalent, so it may only sit on a label PR jobs cannot use - recorded under the trust boundary in [Publishing images to the own registry](decisions/registry-publishing.md). Repo secrets: `REGISTRY_USERNAME`, `REGISTRY_PASSWORD`.
* **Review follow-up** (PR #19, 1 BLOCKER + 4 WARN + 2 NIT): applied the strict `vMAJOR.MINOR.PATCH` check, the newest-release rule for `latest`, a smoke test that starts the image and requires 2xx on `/`, and `timeout-minutes: 20`. Rejected with evidence: the `.dockerignore` leak (`.env*`, `*.pem`, `.git` are excluded) and the Docker-client/daemon API mismatch (20.10.24 client against a 29.9.2 daemon built successfully over the socket).
## 2026-10-23 (PR #16 review checked, three findings applied)
* **Update**: [pr-checker.yml](../.gitea/workflows/pr-checker.yml) - the review prompt now states that `pnpm-lock.yaml` is excluded from `.pr-review-diff.patch` on purpose. The reviewer read the exclusion as an uncommitted lockfile and raised a false BLOCKER; the lockfile is in the PR and matches `package.json`.
* **Fix**: `scripts/generate-favicon.mjs` - `BACKGROUND = null` now writes alpha 0 instead of opaque black, matching the transparency the comment promises. The committed icons are unchanged (regenerated byte-identical).
* **Update**: deleted `public/_robots.txt` - unreferenced leftover from the rename; `@nuxtjs/seo` writes `robots.txt` itself.
## 2026-10-23 (Nuxt SEO configured, static OG card)
* **Decision**: Recorded [SEO stack and site metadata](decisions/seo-and-metadata.md) - `@nuxtjs/seo` 6.0.1 registered; `site` and `schemaOrg.identity` (Person) read `site.config.mjs`; canonical, sitemap, robots and social tags need no per-page setup. `ogImage: false` and `skewProtection: false` because the card is a committed PNG and the site deploys as static files.
* **Update**: `public/og-image.png` (1200x630) and `og-image.alt.txt` generated from the pixel avatar and the site metadata by `pnpm og-image` (`scripts/generate-og-image.mjs`; needs `woff2_decompress` + `rsvg-convert`, output committed). SEO Utils emits `og:image`, `twitter:image` and their dimensions/alt automatically.
* **Detail**: `app/pages/index.vue` sets the title to `Noel Sabia — <role>` and `twitter:card: summary_large_image`; `useHead({ titleTemplate: '%s' })` removes the `| Noel Sabia` suffix SEO Utils would add. `theme-color` is `#031428`.
* **Detail**: `engines.node` is `^22.22.3 || ^24.15.0 || >=26.0.0`, the floor `@nuxtjs/seo` 6 enforces. Verified `nuxt build` and `nuxt generate`: canonical is `https://noelsabia.dev/`, sitemap has one URL, robots allows crawling and names the sitemap, schema graph carries the Person node, and all SEO assets return 200.
## 2026-10-23 (generated pixel favicon)
* **Update**: `public/favicon.svg` and `public/favicon.ico` are generated from the header's pixel avatar by `pnpm favicon` (`scripts/generate-favicon.mjs`). No image library: the ICO is an uncompressed 32bpp BMP in a one-image ICO container (4.2 kB) and the SVG merges same-coloured cells into per-row runs (3.7 kB); a 256px render of both matches.
* **Update**: `app/utils/avatar.js` now holds the palette and the 32x32 sprite as the single source, imported by `AppLogo.vue` and by the generator (plain JS, so Node can import it without a loader). `app.head.link` declares the SVG first and the ICO as the `32x32` fallback.
* **Detail**: the icon keeps the header chip colour `#1b2b3f` as its background so the portrait stays readable on a dark tab bar; `BACKGROUND = null` in the generator makes it transparent.
## 2026-10-23 (icons from Nuxt Icon, icon webfont removed)
* **Decision**: Recorded [Icons via Nuxt Icon](decisions/icons-via-nuxt-icon.md) - all icons come from `@nuxt/icon` with `@iconify-json/material-symbols` installed locally, `mode: 'svg'`, `serverBundle: { collections: [] }`, `clientBundle: { scan: true }`. Deleted `public/fonts/material-symbols-outlined-var.woff2` (3.9 MiB), its `@font-face` and the `.material-symbols-outlined` class in `app/assets/css/main.css`. Build reports 3 icons, 1.23 kB; SSR HTML carries the inline `<svg>`.
* **Update**: The module's defaults would have called `api.iconify.design` at runtime (`mode: css`, `fallbackToApi: true`), which the local collection avoids; `serverBundle: 'auto'` would have bundled the whole set as an 8 MB server chunk.
## 2026-10-20 (cheaper review model, cached installs, merged checks) ## 2026-10-20 (cheaper review model, cached installs, merged checks)
* **Update**: [pr-checker.yml](../.gitea/workflows/pr-checker.yml) - the review model is now `opencode-go/claude-haiku-5-5#medium`: cheap per token and, unlike `deepseek-v4.1-flash`, it has a real `#medium` effort level (flash exposes only low/high/max). ESLint and typecheck are merged into one `checks` job with a single `pnpm install`, and the pnpm store plus the opencode binary are restored with `actions/cache@v4.1.0` (v1 cache API, so it also works on a v1-only runner). Cache keys are built from `sha256sum pnpm-lock.yaml`, the pnpm store layout (`v11`) and the opencode version in shell steps, because `hashFiles()` evaluates empty in this act runner. See [AI review setup](decisions/ai-review-setup.md) and [PR pipeline layering](decisions/pr-pipeline-layering.md). * **Update**: [pr-checker.yml](../.gitea/workflows/pr-checker.yml) - the review model is now `opencode-go/claude-haiku-5-5#medium`: cheap per token and, unlike `deepseek-v4.1-flash`, it has a real `#medium` effort level (flash exposes only low/high/max). ESLint and typecheck are merged into one `checks` job with a single `pnpm install`, and the pnpm store plus the opencode binary are restored with `actions/cache@v4.1.0` (v1 cache API, so it also works on a v1-only runner). Cache keys are built from `sha256sum pnpm-lock.yaml`, the pnpm store layout (`v11`) and the opencode version in shell steps, because `hashFiles()` evaluates empty in this act runner. See [AI review setup](decisions/ai-review-setup.md) and [PR pipeline layering](decisions/pr-pipeline-layering.md).
-24
View File
@@ -27,13 +27,6 @@
font-display: swap; font-display: swap;
src: url('/fonts/jetbrains-mono-var.woff2') format('woff2'); src: url('/fonts/jetbrains-mono-var.woff2') format('woff2');
} }
@font-face {
font-family: 'Material Symbols Outlined';
font-style: normal;
font-weight: 100 700;
font-display: block;
src: url('/fonts/material-symbols-outlined-var.woff2') format('woff2');
}
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@@ -50,20 +43,3 @@
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
} }
@layer components {
.material-symbols-outlined {
font-family: 'Material Symbols Outlined';
font-weight: normal;
font-style: normal;
line-height: 1;
letter-spacing: normal;
text-transform: none;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
display: inline-block;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
-webkit-font-smoothing: antialiased;
}
}
+30
View File
@@ -0,0 +1,30 @@
<template>
<nav
aria-label="Mobile"
class="fixed bottom-0 left-0 w-full z-50 flex md:hidden bg-surface-container-low/90 backdrop-blur-xl shadow-[0_-1px_12px_rgba(0,0,0,0.3)]"
>
<div class="w-full h-16 px-space-xs flex items-center justify-around">
<NuxtLinkLocale
to="/"
class="w-16 h-12 flex flex-col items-center justify-center text-primary font-semibold transition-colors"
>
<Icon name="material-symbols:badge" aria-hidden="true" class="text-[22px]" />
<span class="font-label-mono text-label-mono">{{ $t('nav.overview') }}</span>
</NuxtLinkLocale>
<a
href="#"
class="w-16 h-12 flex flex-col items-center justify-center text-on-surface-variant hover:text-primary transition-colors"
>
<Icon name="material-symbols:timeline" aria-hidden="true" class="text-[22px]" />
<span class="font-label-mono text-label-mono">{{ $t('nav.lifeMap') }}</span>
</a>
<a
href="#"
class="w-16 h-12 flex flex-col items-center justify-center text-on-surface-variant hover:text-primary transition-colors"
>
<Icon name="material-symbols:code" aria-hidden="true" class="text-[22px]" />
<span class="font-label-mono text-label-mono">{{ $t('nav.devView') }}</span>
</a>
</div>
</nav>
</template>
+33
View File
@@ -0,0 +1,33 @@
<script setup lang="ts">
defineProps<{ code: 'en' | 'de' | 'es' | 'it' | 'pl' }>()
</script>
<template>
<svg v-if="code === 'en'" viewBox="0 0 24 16" class="h-full w-full" aria-hidden="true">
<rect width="24" height="16" fill="#012169" />
<path d="M0 0 24 16 M24 0 0 16" stroke="#fff" stroke-width="3.2" />
<path d="M0 0 24 16 M24 0 0 16" stroke="#c8102e" stroke-width="1.6" />
<rect x="10.4" width="3.2" height="16" fill="#fff" />
<rect y="6.4" width="24" height="3.2" fill="#fff" />
<rect x="11" width="2" height="16" fill="#c8102e" />
<rect y="7" width="24" height="2" fill="#c8102e" />
</svg>
<svg v-else-if="code === 'de'" viewBox="0 0 24 16" class="h-full w-full" aria-hidden="true">
<rect width="24" height="5.334" fill="#000" />
<rect y="5.334" width="24" height="5.333" fill="#dd0000" />
<rect y="10.667" width="24" height="5.333" fill="#ffce00" />
</svg>
<svg v-else-if="code === 'es'" viewBox="0 0 24 16" class="h-full w-full" aria-hidden="true">
<rect width="24" height="16" fill="#aa151b" />
<rect y="4" width="24" height="8" fill="#f1bf00" />
</svg>
<svg v-else-if="code === 'it'" viewBox="0 0 24 16" class="h-full w-full" aria-hidden="true">
<rect width="8" height="16" fill="#008c45" />
<rect x="8" width="8" height="16" fill="#f4f5f0" />
<rect x="16" width="8" height="16" fill="#cd212a" />
</svg>
<svg v-else viewBox="0 0 24 16" class="h-full w-full" aria-hidden="true">
<rect width="24" height="8" fill="#fff" />
<rect y="8" width="24" height="8" fill="#dc143c" />
</svg>
</template>
+2 -2
View File
@@ -1,9 +1,9 @@
<template> <template>
<footer class="w-full bg-surface-container-lowest shadow-[0_-1px_12px_rgba(0,0,0,0.3)] py-6"> <footer class="hidden md:block w-full bg-surface-container-lowest shadow-[0_-1px_12px_rgba(0,0,0,0.3)] py-6">
<div class="max-w-7xl mx-auto px-6 lg:px-12 flex flex-col sm:flex-row items-center justify-between gap-4"> <div class="max-w-7xl mx-auto px-6 lg:px-12 flex flex-col sm:flex-row items-center justify-between gap-4">
<div class="flex items-center gap-2.5 font-label-mono text-label-mono text-on-surface-variant"> <div class="flex items-center gap-2.5 font-label-mono text-label-mono text-on-surface-variant">
<span class="inline-block w-2 h-2 rounded-full bg-secondary shadow-[0_0_6px_#4ae176]" /> <span class="inline-block w-2 h-2 rounded-full bg-secondary shadow-[0_0_6px_#4ae176]" />
<span>Served from my own server · k8s · Terraform · self-healing on purpose</span> <span>{{ $t('footer.servedFrom') }}</span>
</div> </div>
<div class="flex items-center gap-3 font-status-badge text-status-badge text-outline"> <div class="flex items-center gap-3 font-status-badge text-status-badge text-outline">
<a <a
+5 -1
View File
@@ -3,7 +3,11 @@
<div class="h-16 max-w-7xl mx-auto px-6 lg:px-12 flex items-center justify-between gap-6"> <div class="h-16 max-w-7xl mx-auto px-6 lg:px-12 flex items-center justify-between gap-6">
<AppLogo /> <AppLogo />
<AppNav /> <AppNav />
<AppQuickLinks /> <div class="flex items-center gap-4">
<AppQuickLinks />
<span class="hidden sm:inline text-[0.625rem] text-outline-variant" aria-hidden="true">/</span>
<AppLanguageSwitcher />
</div>
</div> </div>
</header> </header>
</template> </template>
+84
View File
@@ -0,0 +1,84 @@
<script setup lang="ts">
const { locales, locale, setLocale, t } = useI18n()
const open = ref(false)
const root = ref<HTMLElement | null>(null)
const trigger = ref<HTMLButtonElement | null>(null)
const menuId = useId()
// The accessible name has to contain the visible text (WCAG 2.5.3).
const triggerLabel = computed(() => `${t('switcher.label')}: ${locale.value.toUpperCase()}`)
function closeOnOutside(event: MouseEvent) {
if (!root.value?.contains(event.target as Node)) {
open.value = false
}
}
function closeOnEscape(event: KeyboardEvent) {
if (event.key === 'Escape' && open.value) {
open.value = false
// Focus would otherwise stay on a list item that just left the DOM.
trigger.value?.focus()
}
}
onMounted(() => {
document.addEventListener('click', closeOnOutside)
document.addEventListener('keydown', closeOnEscape)
})
onBeforeUnmount(() => {
document.removeEventListener('click', closeOnOutside)
document.removeEventListener('keydown', closeOnEscape)
})
async function choose(code: Parameters<typeof setLocale>[0]) {
open.value = false
await setLocale(code)
}
</script>
<template>
<div ref="root" class="relative flex shrink-0 items-center font-label-mono text-label-mono">
<button
ref="trigger"
type="button"
class="flex items-center gap-1.5 uppercase tracking-wider text-on-surface-variant transition-colors hover:text-on-surface"
:aria-expanded="open"
:aria-controls="menuId"
:aria-label="triggerLabel"
@click="open = !open"
>
<span class="h-3.5 w-5 overflow-hidden rounded-[2px]">
<AppFlag :code="locale" />
</span>
<span>{{ locale }}</span>
<span aria-hidden="true" class="text-[0.625rem] text-on-surface-variant">▼</span>
</button>
<ul
v-if="open"
:id="menuId"
class="absolute right-0 top-full z-10 mt-2 min-w-48 rounded-lg border border-outline-variant/30 bg-surface-container-high p-1 shadow-lg"
>
<li v-for="language in locales" :key="language.code">
<button
type="button"
class="flex w-full items-center gap-3 rounded px-3 py-2 text-left transition-colors"
:class="locale === language.code
? 'bg-surface-variant text-on-surface'
: 'text-on-surface-variant hover:bg-surface-variant hover:text-on-surface'"
:aria-current="locale === language.code ? 'true' : undefined"
@click="choose(language.code)"
>
<span class="h-3.5 w-5 shrink-0 overflow-hidden rounded-[2px]">
<AppFlag :code="language.code" />
</span>
<span class="flex-1">{{ language.name }}</span>
<span class="uppercase tracking-wider">{{ language.code }}</span>
</button>
</li>
</ul>
</div>
</template>
+6 -53
View File
@@ -1,62 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
// 32x32 sprite: '.' = transparent, letters = palette colors. import { AVATAR_PALETTE, AVATAR_SPRITE } from '~/utils/avatar'
// Head spans half the width (narrow), hoodie fills the bottom as a bust.
// Rows: hair (0-3), hairline/forehead (4-5), glasses (6-8), face (9-12),
// neck (13), shoulders/chest (14-31, drawstrings on 18).
const PALETTE: Record<string, string> = {
H: '#4a2f1d', // hair
S: '#f2cfa5', // skin
F: '#101418', // glasses frame
L: '#cfe3ff', // lens glass
P: '#2e3a45', // pupils
N: '#e0b58f', // nose shade
M: '#c26e57', // smile
h: '#12151a', // hoodie
w: '#e8e8e8', // drawstrings
}
const SPRITE = [ const palette: Record<string, string> = AVATAR_PALETTE
'..........HHHHHHHHHHHH..........',
'.........HHHHHHHHHHHHHH.........',
'........HHHHHHHHHHHHHHHH........',
'........HHHHHHHHHHHHHHHH........',
'........HHSSSSSSSSSSSSHH........',
'........HSSSSSSSSSSSSSSH........',
'........SFFFFFFFFFFFFFFS........',
'........SFLPPLLFFLLPPLFS........',
'........SFLLLLLFFLLLLLFS........',
'........SSSSSSSSSSSSSSSS........',
'........SSSSSSSNNSSSSSSS........',
'........SSSSSSMMMMSSSSSS........',
'..........SSSSSSSSSSSS..........',
'.............SSSSSS.............',
'..........hhhhhhhhhhhh..........',
'.........hhhhhhhhhhhhhh.........',
'........hhhhhhhhhhhhhhhh........',
'.......hhhhhhhhhhhhhhhhhh.......',
'......hhhhhhhhwhhwhhhhhhhh......',
'....hhhhhhhhhhhhhhhhhhhhhhhh....',
'...hhhhhhhhhhhhhhhhhhhhhhhhhh...',
'..hhhhhhhhhhhhhhhhhhhhhhhhhhhh..',
'.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
]
const flat = SPRITE const flat = AVATAR_SPRITE
.flatMap((row) => [...row]) .flatMap((row) => [...row])
.map((cell) => PALETTE[cell] ?? 'transparent') .map((cell) => palette[cell] ?? 'transparent')
</script> </script>
<template> <template>
<NuxtLink to="/" class="group flex items-center gap-3"> <NuxtLinkLocale to="/" class="group flex items-center gap-3">
<span class="flex items-center justify-center w-8 h-8 rounded bg-surface-container-high transition-colors"> <span class="flex items-center justify-center w-8 h-8 rounded bg-surface-container-high transition-colors">
<span class="pixel-avatar" aria-hidden="true"> <span class="pixel-avatar" aria-hidden="true">
<span <span
@@ -71,7 +24,7 @@ const flat = SPRITE
<span class="font-headline-sm text-headline-sm tracking-tight text-on-surface font-medium">Noel Sabia</span> <span class="font-headline-sm text-headline-sm tracking-tight text-on-surface font-medium">Noel Sabia</span>
<span class="font-label-mono text-label-mono text-on-surface-variant tracking-wider uppercase text-[0.625rem]">Im using Arch btw</span> <span class="font-label-mono text-label-mono text-on-surface-variant tracking-wider uppercase text-[0.625rem]">Im using Arch btw</span>
</div> </div>
</NuxtLink> </NuxtLinkLocale>
</template> </template>
<style scoped> <style scoped>
+6 -7
View File
@@ -1,23 +1,22 @@
<template> <template>
<nav class="hidden md:flex items-center gap-1.5"> <nav class="hidden lg:flex items-center gap-1.5">
<NuxtLink <NuxtLinkLocale
to="/" to="/"
aria-current="page"
class="px-3 py-1.5 transition-colors bg-primary-container text-on-primary-container font-medium rounded font-body-sm text-body-sm" class="px-3 py-1.5 transition-colors bg-primary-container text-on-primary-container font-medium rounded font-body-sm text-body-sm"
> >
Overview {{ $t('nav.overview') }}
</NuxtLink> </NuxtLinkLocale>
<a <a
href="#" href="#"
class="px-3 py-1.5 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors font-body-sm text-body-sm" class="px-3 py-1.5 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors font-body-sm text-body-sm"
> >
Life Map {{ $t('nav.lifeMap') }}
</a> </a>
<a <a
href="#" href="#"
class="px-3 py-1.5 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors font-body-sm text-body-sm" class="px-3 py-1.5 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors font-body-sm text-body-sm"
> >
Dev View {{ $t('nav.devView') }}
</a> </a>
</nav> </nav>
</template> </template>
+2 -2
View File
@@ -1,8 +1,8 @@
<template> <template>
<div class="hidden sm:flex items-center gap-4 text-on-surface-variant font-label-mono text-label-mono"> <div class="hidden sm:flex items-center gap-4 text-on-surface-variant font-label-mono text-label-mono">
<a href="#" class="hover:text-on-surface transition-colors">PDF CV</a> <a href="#" class="hover:text-on-surface transition-colors">{{ $t('quickLinks.pdfCv') }}</a>
<span class="text-outline-variant text-[0.625rem]">/</span> <span class="text-outline-variant text-[0.625rem]">/</span>
<a href="#" class="hover:text-on-surface transition-colors">Contact</a> <a href="#" class="hover:text-on-surface transition-colors">{{ $t('quickLinks.contact') }}</a>
<span class="text-outline-variant text-[0.625rem]">/</span> <span class="text-outline-variant text-[0.625rem]">/</span>
<a href="https://github.com/NoelSabia" rel="noopener noreferrer" target="_blank" class="hover:text-on-surface transition-colors">GitHub</a> <a href="https://github.com/NoelSabia" rel="noopener noreferrer" target="_blank" class="hover:text-on-surface transition-colors">GitHub</a>
</div> </div>
+2 -1
View File
@@ -1,9 +1,10 @@
<template> <template>
<div class="flex min-h-screen flex-col"> <div class="flex min-h-screen flex-col pb-16 md:pb-0">
<AppHeader /> <AppHeader />
<main class="w-full flex-1 pt-16 bg-surface"> <main class="w-full flex-1 pt-16 bg-surface">
<slot /> <slot />
</main> </main>
<AppFooter /> <AppFooter />
<AppBottomNav />
</div> </div>
</template> </template>
+13
View File
@@ -1,3 +1,16 @@
<script setup lang="ts">
import { SITE } from '~~/site.config.mjs'
// The description and Open Graph basics come from `site` in nuxt.config.ts;
// the page title adds the role so search results are not just a name.
useSeoMeta({
title: `${SITE.name} — ${SITE.role}`,
twitterCard: 'summary_large_image'
})
// SEO Utils would append "| Noel Sabia" to every title by default.
useHead({ titleTemplate: '%s' })
</script>
<template> <template>
<div /> <div />
</template> </template>
+55
View File
@@ -0,0 +1,55 @@
// Single source for the pixel avatar: the header logo and the generated
// favicon both read this file. `scripts/generate-favicon.mjs` imports it
// with plain Node, so it must stay dependency-free JavaScript.
//
// 32x32 sprite: '.' = transparent, letters = palette colors.
// Head spans half the width (narrow), hoodie fills the bottom as a bust.
// Rows: hair (0-3), hairline/forehead (4-5), glasses (6-8), face (9-12),
// neck (13), shoulders/chest (14-31, drawstrings on 18).
export const AVATAR_PALETTE = {
H: '#4a2f1d', // hair
S: '#f2cfa5', // skin
F: '#101418', // glasses frame
L: '#cfe3ff', // lens glass
P: '#2e3a45', // pupils
N: '#e0b58f', // nose shade
M: '#c26e57', // smile
h: '#12151a', // hoodie
w: '#e8e8e8', // drawstrings
}
export const AVATAR_SPRITE = [
'..........HHHHHHHHHHHH..........',
'.........HHHHHHHHHHHHHH.........',
'........HHHHHHHHHHHHHHHH........',
'........HHHHHHHHHHHHHHHH........',
'........HHSSSSSSSSSSSSHH........',
'........HSSSSSSSSSSSSSSH........',
'........SFFFFFFFFFFFFFFS........',
'........SFLPPLLFFLLPPLFS........',
'........SFLLLLLFFLLLLLFS........',
'........SSSSSSSSSSSSSSSS........',
'........SSSSSSSNNSSSSSSS........',
'........SSSSSSMMMMSSSSSS........',
'..........SSSSSSSSSSSS..........',
'.............SSSSSS.............',
'..........hhhhhhhhhhhh..........',
'.........hhhhhhhhhhhhhh.........',
'........hhhhhhhhhhhhhhhh........',
'.......hhhhhhhhhhhhhhhhhh.......',
'......hhhhhhhhwhhwhhhhhhhh......',
'....hhhhhhhhhhhhhhhhhhhhhhhh....',
'...hhhhhhhhhhhhhhhhhhhhhhhhhh...',
'..hhhhhhhhhhhhhhhhhhhhhhhhhhhh..',
'.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
]
+17
View File
@@ -0,0 +1,17 @@
{
"nav": {
"overview": "Übersicht",
"lifeMap": "Lebenskarte",
"devView": "Dev-Ansicht"
},
"quickLinks": {
"pdfCv": "Lebenslauf (PDF)",
"contact": "Kontakt"
},
"footer": {
"servedFrom": "Betrieben auf meinem eigenen Server · k8s · Terraform"
},
"switcher": {
"label": "Sprache"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"nav": {
"overview": "Overview",
"lifeMap": "Life Map",
"devView": "Dev View"
},
"quickLinks": {
"pdfCv": "PDF CV",
"contact": "Contact"
},
"footer": {
"servedFrom": "Served from my own server · k8s · Terraform"
},
"switcher": {
"label": "Language"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"nav": {
"overview": "Resumen",
"lifeMap": "Mapa de vida",
"devView": "Vista dev"
},
"quickLinks": {
"pdfCv": "CV en PDF",
"contact": "Contacto"
},
"footer": {
"servedFrom": "Servido desde mi propio servidor · k8s · Terraform"
},
"switcher": {
"label": "Idioma"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"nav": {
"overview": "Panoramica",
"lifeMap": "Mappa della vita",
"devView": "Vista dev"
},
"quickLinks": {
"pdfCv": "CV in PDF",
"contact": "Contatti"
},
"footer": {
"servedFrom": "Servito dal mio server · k8s · Terraform"
},
"switcher": {
"label": "Lingua"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"nav": {
"overview": "Przegląd",
"lifeMap": "Mapa życia",
"devView": "Widok dev"
},
"quickLinks": {
"pdfCv": "CV w PDF",
"contact": "Kontakt"
},
"footer": {
"servedFrom": "Hostowane na moim serwerze · k8s · Terraform"
},
"switcher": {
"label": "Język"
}
}
+63 -1
View File
@@ -1,9 +1,71 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
import { SITE } from './site.config.mjs'
export default defineNuxtConfig({ export default defineNuxtConfig({
compatibilityDate: '2025-07-15', compatibilityDate: '2025-07-15',
devtools: { enabled: true }, devtools: { enabled: true },
modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss'], modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss', '@nuxt/icon/module', '@nuxtjs/seo', '@nuxtjs/i18n'],
// Shared by sitemap, robots, canonical URLs, Open Graph and schema.org.
site: {
url: SITE.url,
name: SITE.name,
description: SITE.description,
defaultLocale: SITE.locale,
},
// The social card is a static file (`public/og-image.png`, generated by
// `pnpm og-image`), so the dynamic renderer and its native dependency stay
// out of the build. SEO Utils still emits the og:image and twitter:image tags.
ogImage: false,
// The site is shipped as static files inside the gateway image, so there are
// no old chunk files to keep alive and no CI cache to restore them from.
skewProtection: false,
// A CV is about a person, so the site identity is a Person node; this links
// the auto-generated WebSite/WebPage graph to that person.
schemaOrg: {
identity: {
type: 'Person',
name: SITE.name,
url: SITE.url,
description: SITE.description,
jobTitle: SITE.role,
email: SITE.email,
sameAs: [SITE.github],
},
},
icon: {
// Inline SVG instead of the CSS/mask mode, so icons exist in the SSR HTML
// and survive with JavaScript disabled.
mode: 'svg',
// Only bundle the icons the source actually names, not the whole set.
serverBundle: { collections: [] },
clientBundle: { scan: true }
},
app: {
head: {
link: [
// Generated from app/utils/avatar.js by `pnpm favicon`.
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico', sizes: '32x32' }
],
meta: [
// Matches the page background, so mobile browser chrome blends in.
{ name: 'theme-color', content: '#031428' }
]
}
},
tailwindcss: { tailwindcss: {
cssPath: '~/assets/css/main.css' cssPath: '~/assets/css/main.css'
},
i18n: {
// Absolute URLs for hreflang and the per-locale sitemaps.
baseUrl: SITE.url,
defaultLocale: 'en',
locales: [
{ code: 'en', language: 'en', name: 'English', file: 'en.json' },
{ code: 'de', language: 'de', name: 'Deutsch', file: 'de.json' },
{ code: 'es', language: 'es', name: 'Español', file: 'es.json' },
{ code: 'it', language: 'it', name: 'Italiano', file: 'it.json' },
{ code: 'pl', language: 'pl', name: 'Polski', file: 'pl.json' }
]
} }
}) })
+10 -1
View File
@@ -3,6 +3,9 @@
"version": "1.0.0", "version": "1.0.0",
"type": "module", "type": "module",
"private": true, "private": true,
"engines": {
"node": "^22.22.3 || ^24.15.0 || >=26.0.0"
},
"scripts": { "scripts": {
"build": "nuxt build", "build": "nuxt build",
"dev": "nuxt dev", "dev": "nuxt dev",
@@ -11,9 +14,15 @@
"postinstall": "nuxt prepare", "postinstall": "nuxt prepare",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",
"typecheck": "nuxt typecheck" "typecheck": "nuxt typecheck",
"favicon": "node scripts/generate-favicon.mjs",
"og-image": "node scripts/generate-og-image.mjs"
}, },
"dependencies": { "dependencies": {
"@iconify-json/material-symbols": "^1.2.95",
"@nuxt/icon": "2.6.0",
"@nuxtjs/i18n": "10.6.0",
"@nuxtjs/seo": "6.0.1",
"@nuxtjs/tailwindcss": "6.14.0", "@nuxtjs/tailwindcss": "6.14.0",
"nuxt": "^4.6.2", "nuxt": "^4.6.2",
"vue": "^3.5.43", "vue": "^3.5.43",
+2464 -57
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -33,3 +33,4 @@ minimumReleaseAgeExclude:
- '@rollup/rollup-openbsd-x64@4.64.8' - '@rollup/rollup-openbsd-x64@4.64.8'
- '@rollup/rollup-openharmony-arm64@4.64.8' - '@rollup/rollup-openharmony-arm64@4.64.8'
- '@rollup/rollup-win32-ia32-msvc@4.64.8' - '@rollup/rollup-win32-ia32-msvc@4.64.8'
- '@nuxt/icon@2.6.0'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

+65
View File
@@ -0,0 +1,65 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges">
<rect width="32" height="32" fill="#1b2b3f"/>
<rect x="10" y="0" width="12" height="1" fill="#4a2f1d"/>
<rect x="9" y="1" width="14" height="1" fill="#4a2f1d"/>
<rect x="8" y="2" width="16" height="1" fill="#4a2f1d"/>
<rect x="8" y="3" width="16" height="1" fill="#4a2f1d"/>
<rect x="8" y="4" width="2" height="1" fill="#4a2f1d"/>
<rect x="10" y="4" width="12" height="1" fill="#f2cfa5"/>
<rect x="22" y="4" width="2" height="1" fill="#4a2f1d"/>
<rect x="8" y="5" width="1" height="1" fill="#4a2f1d"/>
<rect x="9" y="5" width="14" height="1" fill="#f2cfa5"/>
<rect x="23" y="5" width="1" height="1" fill="#4a2f1d"/>
<rect x="8" y="6" width="1" height="1" fill="#f2cfa5"/>
<rect x="9" y="6" width="14" height="1" fill="#101418"/>
<rect x="23" y="6" width="1" height="1" fill="#f2cfa5"/>
<rect x="8" y="7" width="1" height="1" fill="#f2cfa5"/>
<rect x="9" y="7" width="1" height="1" fill="#101418"/>
<rect x="10" y="7" width="1" height="1" fill="#cfe3ff"/>
<rect x="11" y="7" width="2" height="1" fill="#2e3a45"/>
<rect x="13" y="7" width="2" height="1" fill="#cfe3ff"/>
<rect x="15" y="7" width="2" height="1" fill="#101418"/>
<rect x="17" y="7" width="2" height="1" fill="#cfe3ff"/>
<rect x="19" y="7" width="2" height="1" fill="#2e3a45"/>
<rect x="21" y="7" width="1" height="1" fill="#cfe3ff"/>
<rect x="22" y="7" width="1" height="1" fill="#101418"/>
<rect x="23" y="7" width="1" height="1" fill="#f2cfa5"/>
<rect x="8" y="8" width="1" height="1" fill="#f2cfa5"/>
<rect x="9" y="8" width="1" height="1" fill="#101418"/>
<rect x="10" y="8" width="5" height="1" fill="#cfe3ff"/>
<rect x="15" y="8" width="2" height="1" fill="#101418"/>
<rect x="17" y="8" width="5" height="1" fill="#cfe3ff"/>
<rect x="22" y="8" width="1" height="1" fill="#101418"/>
<rect x="23" y="8" width="1" height="1" fill="#f2cfa5"/>
<rect x="8" y="9" width="16" height="1" fill="#f2cfa5"/>
<rect x="8" y="10" width="7" height="1" fill="#f2cfa5"/>
<rect x="15" y="10" width="2" height="1" fill="#e0b58f"/>
<rect x="17" y="10" width="7" height="1" fill="#f2cfa5"/>
<rect x="8" y="11" width="6" height="1" fill="#f2cfa5"/>
<rect x="14" y="11" width="4" height="1" fill="#c26e57"/>
<rect x="18" y="11" width="6" height="1" fill="#f2cfa5"/>
<rect x="10" y="12" width="12" height="1" fill="#f2cfa5"/>
<rect x="13" y="13" width="6" height="1" fill="#f2cfa5"/>
<rect x="10" y="14" width="12" height="1" fill="#12151a"/>
<rect x="9" y="15" width="14" height="1" fill="#12151a"/>
<rect x="8" y="16" width="16" height="1" fill="#12151a"/>
<rect x="7" y="17" width="18" height="1" fill="#12151a"/>
<rect x="6" y="18" width="8" height="1" fill="#12151a"/>
<rect x="14" y="18" width="1" height="1" fill="#e8e8e8"/>
<rect x="15" y="18" width="2" height="1" fill="#12151a"/>
<rect x="17" y="18" width="1" height="1" fill="#e8e8e8"/>
<rect x="18" y="18" width="8" height="1" fill="#12151a"/>
<rect x="4" y="19" width="24" height="1" fill="#12151a"/>
<rect x="3" y="20" width="26" height="1" fill="#12151a"/>
<rect x="2" y="21" width="28" height="1" fill="#12151a"/>
<rect x="1" y="22" width="30" height="1" fill="#12151a"/>
<rect x="0" y="23" width="32" height="1" fill="#12151a"/>
<rect x="0" y="24" width="32" height="1" fill="#12151a"/>
<rect x="0" y="25" width="32" height="1" fill="#12151a"/>
<rect x="0" y="26" width="32" height="1" fill="#12151a"/>
<rect x="0" y="27" width="32" height="1" fill="#12151a"/>
<rect x="0" y="28" width="32" height="1" fill="#12151a"/>
<rect x="0" y="29" width="32" height="1" fill="#12151a"/>
<rect x="0" y="30" width="32" height="1" fill="#12151a"/>
<rect x="0" y="31" width="32" height="1" fill="#12151a"/>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.
+1
View File
@@ -0,0 +1 @@
Noel Sabia — Programmer, AI Assisted Coder, Arch user. Pixel portrait next to the CV title, with the line "Every chapter runs as a real Kubernetes workload — knock it down and watch it recover."
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

-2
View File
@@ -1,2 +0,0 @@
User-Agent: *
Disallow:
+110
View File
@@ -0,0 +1,110 @@
// Generates public/favicon.svg and public/favicon.ico from the pixel avatar in
// app/utils/avatar.js, so the sprite exists once. Run with `pnpm favicon`.
//
// No image library: the sprite is 32x32 cells, so the ICO is written as an
// uncompressed 32bpp BMP inside a one-image ICO container (4.2 kB), and the SVG
// merges each run of same-coloured cells per row into one rect.
import { mkdirSync, writeFileSync } from 'node:fs'
import { join } from 'node:path'
import { AVATAR_PALETTE, AVATAR_SPRITE } from '../app/utils/avatar.js'
const SIZE = 32
// Same chip colour the logo sits on in the header, so the portrait stays
// readable on a dark browser tab bar. Set to null for a transparent icon.
const BACKGROUND = '#1b2b3f'
const OUT_DIR = join(import.meta.dirname, '..', 'public')
const hex = (value) => {
const n = Number.parseInt(value.slice(1), 16)
return [n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff]
}
const colorAt = (x, y) => {
const cell = AVATAR_SPRITE[y]?.[x] ?? '.'
return AVATAR_PALETTE[cell] ?? BACKGROUND
}
// --- SVG -------------------------------------------------------------------
const svg = () => {
const rects = []
for (let y = 0; y < SIZE; y++) {
let x = 0
while (x < SIZE) {
const color = colorAt(x, y)
let run = 1
while (x + run < SIZE && colorAt(x + run, y) === color) run++
if (color && color !== BACKGROUND) rects.push(`<rect x="${x}" y="${y}" width="${run}" height="1" fill="${color}"/>`)
x += run
}
}
const background = BACKGROUND
? `<rect width="${SIZE}" height="${SIZE}" fill="${BACKGROUND}"/>`
: ''
return [
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${SIZE} ${SIZE}" width="${SIZE}" height="${SIZE}" shape-rendering="crispEdges">`,
...(background ? [background] : []),
...rects,
'</svg>',
// Keep the trailing newline: the end-of-file-fixer pre-commit hook wants it.
'',
].join('\n')
}
// --- ICO -------------------------------------------------------------------
const ico = () => {
const xorSize = SIZE * SIZE * 4
const maskRow = Math.ceil(SIZE / 32) * 4
const maskSize = maskRow * SIZE
const bitmap = Buffer.alloc(40 + xorSize + maskSize)
bitmap.writeUInt32LE(40, 0) // BITMAPINFOHEADER size
bitmap.writeInt32LE(SIZE, 4) // width
bitmap.writeInt32LE(SIZE * 2, 8) // height: XOR image + AND mask
bitmap.writeUInt16LE(1, 12) // planes
bitmap.writeUInt16LE(32, 14) // bits per pixel
bitmap.writeUInt32LE(xorSize + maskSize, 20) // image size
// XOR bitmap: bottom-up rows of BGRA. With a null BACKGROUND the pixel stays
// zeroed and alpha 0, which is how a 32bpp ICO carries transparency.
let offset = 40
for (let y = SIZE - 1; y >= 0; y--) {
for (let x = 0; x < SIZE; x++) {
const color = colorAt(x, y)
const [r, g, b] = color ? hex(color) : [0, 0, 0]
bitmap[offset++] = b
bitmap[offset++] = g
bitmap[offset++] = r
bitmap[offset++] = color ? 0xff : 0
}
}
// AND mask stays zeroed: 32bpp readers use the alpha channel instead.
const header = Buffer.alloc(6)
header.writeUInt16LE(0, 0) // reserved
header.writeUInt16LE(1, 2) // type: icon
header.writeUInt16LE(1, 4) // image count
const entry = Buffer.alloc(16)
entry[0] = SIZE // width
entry[1] = SIZE // height
entry[2] = 0 // palette colours
entry[3] = 0 // reserved
entry.writeUInt16LE(1, 4) // planes
entry.writeUInt16LE(32, 6) // bits per pixel
entry.writeUInt32LE(bitmap.length, 8)
entry.writeUInt32LE(header.length + entry.length, 12)
return Buffer.concat([header, entry, bitmap])
}
// --- write -----------------------------------------------------------------
mkdirSync(OUT_DIR, { recursive: true })
const svgFile = join(OUT_DIR, 'favicon.svg')
const icoFile = join(OUT_DIR, 'favicon.ico')
writeFileSync(svgFile, svg())
writeFileSync(icoFile, ico())
console.log(`wrote ${svgFile} and ${icoFile}`)
+117
View File
@@ -0,0 +1,117 @@
// Generates public/og-image.png (1200x630) and its alt text from the site
// metadata and the pixel avatar. Run with `pnpm og-image`.
//
// Needs two system tools that the rest of the project does not:
// woff2_decompress (font/woff2) - turns the self-hosted woff2 files into
// TTF, because librsvg cannot read woff2
// rsvg-convert (librsvg) - rasterizes the SVG card
// The generated PNG is committed, so neither tool is needed to build or deploy.
import { execFileSync } from 'node:child_process'
import { copyFileSync, mkdirSync, writeFileSync } from 'node:fs'
import { join } from 'node:path'
import { SITE } from '../site.config.mjs'
import { AVATAR_PALETTE, AVATAR_SPRITE } from '../app/utils/avatar.js'
const WIDTH = 1200
const HEIGHT = 630
const ROOT = join(import.meta.dirname, '..')
const OUT_DIR = join(ROOT, 'public')
const FONT_DIR = join(ROOT, 'node_modules', '.cache', 'og-image-fonts')
// Brand fonts, normalised name -> file in public/fonts.
const FONTS = [
['Inter', 'inter-var.woff2'],
['JetBrains Mono', 'jetbrains-mono-var.woff2'],
// The variable Newsreader file carries its optical-size name.
['Newsreader 16pt', 'newsreader-var.woff2'],
]
// --- fonts -----------------------------------------------------------------
const prepareFonts = () => {
mkdirSync(FONT_DIR, { recursive: true })
for (const [, file] of FONTS) {
copyFileSync(join(ROOT, 'public', 'fonts', file), join(FONT_DIR, file))
execFileSync('woff2_decompress', [join(FONT_DIR, file)], { stdio: 'ignore' })
}
const conf = join(FONT_DIR, 'fonts.conf')
writeFileSync(conf, `<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>${FONT_DIR}</dir>
<cachedir>${join(FONT_DIR, 'cache')}</cachedir>
</fontconfig>
`)
return conf
}
// --- card ------------------------------------------------------------------
const avatar = () => {
const scale = 8
const x = 88
const y = (HEIGHT - 32 * scale) / 2
const cells = []
for (let row = 0; row < 32; row++) {
for (let col = 0; col < 32; col++) {
const color = AVATAR_PALETTE[AVATAR_SPRITE[row][col]]
if (!color) continue
cells.push(
`<rect x="${col}" y="${row}" width="1" height="1" fill="${color}"/>`,
)
}
}
return [
// Chip, the same surface the avatar sits on in the header.
`<rect x="${x}" y="${y}" width="${32 * scale}" height="${32 * scale}" fill="#1b2b3f"/>`,
`<rect x="${x}" y="${y}" width="${32 * scale}" height="${32 * scale}" fill="none" stroke="#2a3a4f" stroke-width="1"/>`,
`<g transform="translate(${x} ${y}) scale(${scale})" shape-rendering="crispEdges">`,
...cells,
'</g>',
].join('\n')
}
const card = () => {
const textX = 400
const textRight = WIDTH - 88
const mono = `font-family="'JetBrains Mono', monospace"`
const sans = `font-family="'Inter', sans-serif"`
const serif = `font-family="'Newsreader 16pt', serif"`
return `<svg xmlns="http://www.w3.org/2000/svg" width="${WIDTH}" height="${HEIGHT}" viewBox="0 0 ${WIDTH} ${HEIGHT}">
<rect width="${WIDTH}" height="${HEIGHT}" fill="#031428"/>
<rect x="24" y="24" width="${WIDTH - 48}" height="${HEIGHT - 48}" fill="none" stroke="#1b2b3f" stroke-width="1"/>
${avatar()}
<circle cx="${textX + 5}" cy="194" r="5" fill="#4ae176"/>
<text x="${textX + 22}" y="200" ${mono} font-size="16" letter-spacing="3" fill="#a9c9f7">SYS_ORCHESTRATOR // RESILIENCE LABS</text>
<text x="${textX}" y="312" ${serif} font-size="88" fill="#d3e4ff">${SITE.name}</text>
<text x="${textX}" y="362" ${sans} font-size="27" fill="#c3c6cf">${SITE.role}</text>
<line x1="${textX}" y1="400" x2="${textRight}" y2="400" stroke="#1b2b3f" stroke-width="1"/>
<text x="${textX}" y="446" ${sans} font-size="21" fill="#8d9199">Every chapter runs as a real Kubernetes workload —</text>
<text x="${textX}" y="478" ${sans} font-size="21" fill="#8d9199">knock it down and watch it recover.</text>
<circle cx="${textX + 5}" cy="552" r="5" fill="#4ae176"/>
<text x="${textX + 22}" y="558" ${mono} font-size="18" fill="#c3c6cf">noelsabia.dev</text>
<text x="${textRight}" y="558" ${mono} font-size="14" letter-spacing="2" fill="#8d9199" text-anchor="end">CV // ${new Date().getUTCFullYear()}</text>
</svg>
`
}
// --- write -----------------------------------------------------------------
const fontsConf = prepareFonts()
const svgFile = join(FONT_DIR, 'og-image.svg')
const pngFile = join(OUT_DIR, 'og-image.png')
writeFileSync(svgFile, card())
execFileSync(
'rsvg-convert',
['-w', String(WIDTH), '-h', String(HEIGHT), svgFile, '-o', pngFile],
{ env: { ...process.env, FONTCONFIG_FILE: fontsConf }, stdio: 'inherit' },
)
writeFileSync(
join(OUT_DIR, 'og-image.alt.txt'),
`${SITE.name} — ${SITE.role}. Pixel portrait next to the CV title, with the line "Every chapter runs as a real Kubernetes workload — knock it down and watch it recover."\n`,
)
console.log(`wrote ${pngFile} and ${join(OUT_DIR, 'og-image.alt.txt')}`)
+16
View File
@@ -0,0 +1,16 @@
// Single source for the site metadata that Nuxt SEO, schema.org and the
// generated OG card all read. Plain ESM so `nuxt.config.ts` and the scripts in
// `scripts/` can import it without a loader.
export const SITE = {
url: 'https://noelsabia.dev',
name: 'Noel Sabia',
role: 'Programmer, AI Assisted Coder, Arch user',
description:
'Interactive CV of Noel Sabia, infrastructure and AI engineer: every chapter runs as a Kubernetes workload you can knock down and watch recover.',
// One language tag: `defaultLocale` ends up in <html lang> and og:locale.
// German needs @nuxtjs/i18n and a real translation before it can be listed.
locale: 'en',
email: 'noel@noelsabia.dev',
github: 'https://github.com/NoelSabia',
}