Skip to content

feat: Open Graph image route, feed caching, customers marquee and phone number - #140

Merged
danielheene merged 27 commits into
developfrom
feat/phone-number-and-worker-revalidation
Nov 19, 2026
Merged

danielheene merged 27 commits into
developfrom
feat/phone-number-and-worker-revalidation

Conversation

@danielheene

@danielheene danielheene commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Open Graph images

  • All Open Graph cards now come from one route, /api/og-image, replacing the seven opengraph-image.tsx files.
    • It takes a site path (?path=/blog/post/my-post) or a collection and slug (?collection=posts&slug=my-post), so any card can be previewed in the browser.
    • It answers 400 for bad parameters and 404 for unknown documents.
  • Every card uses one template:
    • The page's hero in the brand duotone: an image, a video poster or a shader thumbnail, falling back to the site default.
    • The logo and site address along the top.
    • Topic badges or a label above the title, with the post's primary topic highlighted.
    • The title in PP Supply Sans, and the meta description in PP Frama, capped at two lines.
  • Page metadata links each card with a v version taken from the document's last change. Those URLs are cached as immutable; previews without v are no-cache.
  • /resume has a working card again; the resume folder used to shadow it.
  • The post page's structured-data image pointed at a URL that returned 404; it now points at the new route.
  • Supporting changes:
    • The published-topic query moves to src/lib/fetchers/.
    • The resume document description is a shared helper, so the page and its card use the same text.
    • The logo's inline paths are shared between the Logo component and the card template.

RSS feed

  • /blog/feed.xml sends ETag, Last-Modified and Cache-Control, and answers conditional requests with 304. Readers that already have the current feed no longer download all of it again.

Customers and media

  • The customers section has a diagonal marquee of every customer logo as its background, with the title and caption on a centred 16:9 panel.
  • Hero slide previews in the admin use ImageMedia and VideoMedia, so they get responsive images and blur-up.
  • ImageMedia resolves relative URLs and positions fill images correctly.
  • Shader thumbnails fill the blog cards.

Structured data (JSON-LD)

  • Every page renders one linked @graph. The site-wide Person (/#person), WebSite (/#website) and Blog (/blog#blog) each exist once; every other node points at them by @id.
  • Fixes to the existing schemas:
    • Person: the address uses PostalAddress properties, and the portrait now appears.
    • Person: givenName and familyName are added, and birth date and gender are no longer published.
    • WebSite: the default image now appears, and the person is its publisher.
    • Image uploads are recognized by URL, because their populated form has no mimeType. That had hidden every image.
  • Blog posts now render their BlogPosting and breadcrumb; before, both were built but never output.
    • The posting carries the description, topics, word count, reading time, and the hero and card images.
    • The breadcrumb runs Home → Blog → primary topic → post.
  • New per route:
    • / is a ProfilePage about the owner.
    • /resume is also a ProfilePage, and adds the jobs held, skills and projects to the person.
    • Other CMS pages are a WebPage with a breadcrumb.
    • /blog and /blog/<topic> are CollectionPages listing their posts.
    • /resume/<doc> is a DigitalDocument with each language's PDF, its SHA-256 checksum and size.
  • Note on /resume: /resume is a document in the pages collection (slug resume, RESUME_PAGE_SLUG). The resume-documents collection only serves the generated PDFs under /resume/<slug>. The resume page's structured data therefore comes from the page route, app/(frontend)/[slug]/page.tsx, which adds the career nodes when the slug is resume.
  • The unused Organization, SoftwareSourceCode and CollectionPage generators are removed.

Earlier commits on this branch

  • Phone number: stored as a structured field, with a refreshed resume UI.
  • Revalidation: the jobs worker revalidates through /api/revalidate.
  • Pages: split into RichText Content and Section Content layouts.
  • Hero: white header and hero text over the blue hero canvas, and overlaid content renders above the hero media.
  • Navigation:
    • The section navigation is driven by extractHeadings.
    • Navigating to an uncached page scrolls to the top.
  • Shaders: the WebGL context stays alive across effect re-runs.
  • Legal blocks: renamed to LegalPublisherInformation and LegalAttributions.
  • Site settings: defaults are derived on read instead of being stored, and the meta title is read-only and regenerated on read.
  • Env: drops the deprecated domain and SERVER_URL fallbacks.
  • Docs: AGENTS.md lists the newer scripts.
  • Other: container padding is widened to 2rem, and the dev server runs on turbopack again.

Verification

  • bunx tsc --noEmit is clean, and bun run test passes all 1,042 tests (126 files).
  • bun run build succeeds. It also prints "Compiled with warnings" without listing them; that cause isn't looked into here.
  • All three card fonts are traced into .next/standalone, and the standalone server rendered a card.
  • On the dev server, every page type has exactly one og:image tag, and each of those image URLs returns a JPEG.

Next's revalidateTag/revalidatePath throw outside a Next request context,
so every hook that fired in the standalone jobs worker (scheduled
publishes, createResumeDocument) silently skipped invalidation and left
pages stale until their cacheLife expired.

- revalidateCache() calls Next directly when it can and otherwise POSTs
  the same tags/paths to /api/revalidate; it never throws, so a failed
  invalidation cannot fail the write.
- /api/revalidate requires a bearer token derived from PAYLOAD_SECRET
  (timing-safe compare) and validates tags and same-site paths.
- Collection hooks, the resume-section hook and the fetchers' revalidate*
  helpers go through revalidateCache.
…esh the resume UI

Phone number
- The user settings' `telephone` text field becomes a `phoneNumber`
  group: `value` is validated with libphonenumber (international format,
  or national with the address country) and stored as E.164; `formatted`
  and `uri` are derived on read. Shared helpers live in
  SettingsGlobalUser/phoneNumber.ts.
- Migration 00000008 moves the stored `telephone` into
  `phoneNumber.value`.
- Footer, legal publisher block, JSON-LD and the PDF header read the
  derived values; the links are hidden when no valid number is set, and
  the PDF schema checks the tel: URI as E.164 again.
- Text fields in the settings are trimmed before validation.

Resume UI
- Reveal folds useReveal into the component and owns its styles.
- The checksum validator accepts pasted PDFs and pasted SHA-256 hashes.
- fetchDocumentBySlug selects only the fields it returns; the downloads
  block reads the latest document through it.
- Experience entries show their skill tags; badge, logo tile and
  dropzone styling tweaks.
…d LegalAttributions

Gives the two legal blocks names that say what they render, and moves the
publisher block's admin hint into its own AdminInfo component like the
attributions block.
Hero shaders rendered only in Storybook: each shader called
WEBGL_lose_context.loseContext() in its effect cleanup, so React's Strict
Mode re-run (and <Activity>) got a dead context on the same canvas. The
browser frees the context once the canvas leaves the DOM.

The admin now shows each preset's thumbnail.png (ShaderThumbnail) instead of
live preview canvases.
extractHeadings now walks a Lexical document or a page's block list with one
shared id generator: a block's title becomes a level-1 section, and a
RichTextBlock's headings follow it, nested one level deeper when the block has
a title. RenderBlocks hands each block its anchor ids from that single run, so
ids stay unique across the page; ids are slugified with dashes.

The scroll-spy logic from TableOfContents moves into useScrollSpy, which
SectionNavigation now uses directly. The navigation context, provider,
display component and portal-host hook are gone, and SectionContainer is a
plain server-compatible section.

RichText takes the precomputed heading ids, and also gains a renderedBlocks
prop for blocks whose renderers are async Server Components
(serverRenderedBlockSlugs).
The page shells wrapped their content in a Suspense boundary without a
fallback, so during a navigation that had to load the new page its segment
rendered nothing. Next scrolls to the new page's first rendered element;
with none it skipped the scroll and the reader kept the previous page's
offset. PageFallback gives the boundary a full-height element to scroll to.
…youts

A page is now either richText - a content rich-text field rendered like a
blog post - or sections, the former blocks field (now sections). Both blog
posts and rich-text pages render through the new ArticleLayout: content
column plus a sidebar with the table of contents and the links group, which
pages gain as a Links tab.

- Resume blocks are offered only on the resume page, which alone gets the
  section navigation.
- The legal blocks lose their title field and move into rich text. Lexical
  cannot offer blocks per document, so validation rejects them outside
  legal-notice and privacy-policy. Their async renderers are pre-rendered by
  renderServerBlocks and handed to RichText by block id.
- Migration 00000009 converts pages and their versions: the legal pages
  become rich text (old block titles become h2 headings above the embedded
  blocks), every other page keeps its blocks as sections.
- Seeds, the initial migration and the resume revalidation hook use the new
  layout values; the resume page is matched by slug.
- fetchPageBySlug defaults to the home slug.
The 404 heading and button sat below the hero video. DuoTone's stylesheet
was unlayered, so it beat Tailwind utilities and its contained variant's
relative overrode HeroMedia's absolute inset-0; that variant also kept the
base display: contents, so the wrapper had no box at all. The media stayed
in flow at its natural height and pushed centred content down.

The rules now live in @layer components, and the contained variant is a
real block box.
The hero media always renders as the blue duotone, so text on it is now
white in both themes: HeroMedia sets it on its overlaid content and marks
its section with data-hero, and the header turns white while a hero is
present (including the nav links, whose button styles read
--color-foreground).

An eased gradient (tw-easing-gradients) fades from the brand blue at the
top of the hero to keep the header readable over bright media, and the
header logo is a step larger than the navigation text.
SERVER_URL is a required URL in the env schema that next.config.ts enforces
at startup, so the fallbacks were dead code - including the deprecated
danielheene.de domain on blog posts.

The blog post's structured-data URL now points at the real /blog/post/<slug>
route instead of /posts/<slug>.
Turbopack's dev server kept failing with a stale client-reference error
(Slug FieldComponent) after edits to modules the frontend layout imports.
ImageMedia resolves relative sources against NEXT_PUBLIC_SERVER_URL, gives
fill images a positioned wrapper so next/image stops warning, and uses a
per-instance blur filter id. Drops leftover debug logging in both media
components.
Previews get responsive images and the blur-up placeholder. Videos with a
known file now preview as video with their poster frame, and the shader
thumbnails load through ImageMedia as well.
Rows of customer logos, each row shuffled server-side inside the cache,
scroll diagonally behind a centred 16:9 panel holding the title and caption.
Rows size themselves to cover the section at any width.
The feed now sends ETag, Last-Modified and Cache-Control, so readers that
already hold the current version revalidate instead of downloading it again.
Site name, category, host and URL fall back to their defaults when read
instead of being stored, so the initial migration no longer seeds them. The
meta title is read-only and regenerated on read.
Cards share one template: the hero (image, video poster or shader thumbnail,
falling back to the site default) in the brand duotone, the logo and site
address on top, topic badges or a label, the title in PP Supply Sans and the
meta description in PP Frama, rendered as JPEG. The route takes a path or a
collection and slug, so any card can be previewed; page metadata links it
with a version so the URLs can be cached for good. This also gives /resume a
working image again, which the resume folder used to shadow.

The published-topic query moves to the fetchers, and the resume document
description becomes a shared helper, so pages and cards use the same text.
@kilo-code-bot

kilo-code-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/lib/jsonLd/JsonLd.tsx - one changed line: adds a // nosemgrep: react-dangerouslysetinnerhtml comment to the reviewed dangerouslySetInnerHTML line (no behavioral change)
Previous Review Summaries (3 snapshots, latest commit c6cc6db)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit c6cc6db)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/lib/jsonLd/routeGraphs.ts - refactor: replace hardcoded 'resume' slug with RESUME_PAGE_SLUG constant (no behavioral change)

Previous review (commit 7e7f863)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (27 files)
  • app/(frontend)/[slug]/page.tsx
  • app/(frontend)/blog/_shared/BlogListPage.tsx
  • app/(frontend)/blog/post/[slug]/page.tsx
  • app/(frontend)/layout.tsx
  • app/(frontend)/resume/[slug]/page.tsx
  • src/lib/jsonLd/JsonLd.tsx
  • src/lib/jsonLd/generateBlog.ts
  • src/lib/jsonLd/generateBlogPosting.ts
  • src/lib/jsonLd/generateBreadcrumbList.ts
  • src/lib/jsonLd/generateCollectionPage.ts
  • src/lib/jsonLd/generateCreativeWork.ts
  • src/lib/jsonLd/generateDigitalDocument.ts
  • src/lib/jsonLd/generateItemList.ts
  • src/lib/jsonLd/generateOccupation.ts
  • src/lib/jsonLd/generateOrganization.ts
  • src/lib/jsonLd/generatePersonSchema.ts
  • src/lib/jsonLd/generateSoftwareSourceCode.ts
  • src/lib/jsonLd/generateWebPage.ts
  • src/lib/jsonLd/generateWebSiteSchema.ts
  • src/lib/jsonLd/graph.ts
  • src/lib/jsonLd/ids.ts
  • src/lib/jsonLd/imageObject.ts
  • src/lib/jsonLd/index.ts
  • src/lib/jsonLd/jsonLd.shared.test.ts
  • src/lib/jsonLd/jsonLd.test.ts
  • src/lib/jsonLd/postalAddress.ts
  • src/lib/jsonLd/routeGraphs.ts

Previous review (commit 137e50c)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (27 files)
  • app/(frontend)/api/og-image/route.ts
  • src/lib/og/ogTarget.ts
  • src/lib/og/renderOgImage.tsx
  • src/lib/og/renderOgImageForTarget.tsx
  • src/lib/og/resolveOgBackground.ts
  • src/lib/resumeDocumentDescription.ts
  • app/(frontend)/blog/feed.xml/route.ts
  • src/lib/conditionalGet.ts

Reviewed by free · Input: 0 · Output: 0 · Cached: 0

Pages now emit a single @graph whose nodes reference the site-wide
Person, WebSite and Blog by @id instead of unrelated copies.

- Person: the address uses PostalAddress properties, the portrait
  appears (image uploads are recognized by URL, since their populated
  form omits mimeType), givenName and familyName are added, and birth
  date and gender are no longer published.
- WebSite: the default image appears and the person is its publisher.
- Blog posts render their BlogPosting and breadcrumb, which were built
  but never output, now with description, topics, word count, reading
  time, hero and card images, and a trail through the primary topic.
- Images carry their pixel size and stored credits as creditText.
- The unused Organization, SoftwareSourceCode and CollectionPage
  generators are removed.
…documents

- Home and resume are ProfilePages about the site owner; the resume adds
  the jobs held, skills and projects to the person.
- Other CMS pages are WebPages with a breadcrumb.
- The blog and topic listings are CollectionPages listing their posts.
- Resume documents are DigitalDocuments with each language's PDF, its
  SHA-256 checksum and size.
/resume is a pages document; resume-documents only serves the PDFs
under /resume/<slug>.
@danielheene
danielheene merged commit 3c155ed into develop Nov 19, 2026
5 checks passed
@danielheene
danielheene deleted the feat/phone-number-and-worker-revalidation branch November 19, 2026 14:49
danielheene-website-release Bot pushed a commit that referenced this pull request Nov 19, 2026
# [1.17.0-rc.3](v1.17.0-rc.2...v1.17.0-rc.3) (2026-11-19)

### Features

* Open Graph route, structured data, feed caching, customers marquee and phone number ([#140](#140)) ([3c155ed](3c155ed))
@danielheene-website-release

Copy link
Copy Markdown

🎉 This PR is included in version 1.17.0-rc.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant