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 / 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 1m11s
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 / 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 1m11s
- 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
This commit is contained in:
1 parent
24460083ff
commit
1c3503fed0
18 files changed
+1765
-116
No files matched your search
@@ -12,3 +12,4 @@
|
||||
* [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.
|
||||
* [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.
|
||||
@@ -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.
|
||||
@@ -35,6 +35,7 @@ config files — the configs say what, these documents say why.
|
||||
## 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
|
||||
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# Update Log
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -1,58 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
// 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).
|
||||
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
|
||||
}
|
||||
import { AVATAR_PALETTE, AVATAR_SPRITE } from '~/utils/avatar'
|
||||
|
||||
const 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',
|
||||
]
|
||||
const palette: Record<string, string> = AVATAR_PALETTE
|
||||
|
||||
const flat = SPRITE
|
||||
const flat = AVATAR_SPRITE
|
||||
.flatMap((row) => [...row])
|
||||
.map((cell) => PALETTE[cell] ?? 'transparent')
|
||||
.map((cell) => palette[cell] ?? 'transparent')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -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>
|
||||
<div />
|
||||
</template>
|
||||
@@ -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',
|
||||
]
|
||||
+43
-1
@@ -1,8 +1,37 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
import { SITE } from './site.config.mjs'
|
||||
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true },
|
||||
modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss', '@nuxt/icon/module'],
|
||||
modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss', '@nuxt/icon/module', '@nuxtjs/seo'],
|
||||
// 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.
|
||||
@@ -11,6 +40,19 @@ export default defineNuxtConfig({
|
||||
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: {
|
||||
cssPath: '~/assets/css/main.css'
|
||||
}
|
||||
|
||||
+7
-1
@@ -3,6 +3,9 @@
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "^22.22.3 || ^24.15.0 || >=26.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
@@ -11,11 +14,14 @@
|
||||
"postinstall": "nuxt prepare",
|
||||
"lint": "eslint .",
|
||||
"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": {
|
||||
"@iconify-json/material-symbols": "^1.2.95",
|
||||
"@nuxt/icon": "2.6.0",
|
||||
"@nuxtjs/seo": "6.0.1",
|
||||
"@nuxtjs/tailwindcss": "6.14.0",
|
||||
"nuxt": "^4.6.2",
|
||||
"vue": "^3.5.43",
|
||||
|
||||
Generated
+1225
-63
File diff suppressed because it is too large.
Load diff
File renamed without changes.
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -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 |
@@ -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 |
@@ -0,0 +1,108 @@
|
||||
// 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.
|
||||
let offset = 40
|
||||
for (let y = SIZE - 1; y >= 0; y--) {
|
||||
for (let x = 0; x < SIZE; x++) {
|
||||
const [r, g, b] = hex(colorAt(x, y) ?? '#000000')
|
||||
bitmap[offset++] = b
|
||||
bitmap[offset++] = g
|
||||
bitmap[offset++] = r
|
||||
bitmap[offset++] = 0xff
|
||||
}
|
||||
}
|
||||
// AND mask stays zeroed: every pixel is opaque.
|
||||
|
||||
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}`)
|
||||
@@ -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')}`)
|
||||
@@ -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',
|
||||
}
|
||||
Reference in new issue
Block a user