Skip to content

refactor: centralize project metadata and move legal page data to env vars#38

Merged
toddeTV merged 27 commits into
mainfrom
refactor/project-metadata-centralization
May 19, 2026
Merged

refactor: centralize project metadata and move legal page data to env vars#38
toddeTV merged 27 commits into
mainfrom
refactor/project-metadata-centralization

Conversation

@toddeTV
Copy link
Copy Markdown
Owner

@toddeTV toddeTV commented May 19, 2026

Summary by CodeRabbit

  • New Features

    • Legal notice and privacy pages use configurable placeholders; new components render legal name, occupation, and contact when set
    • OG images, footer, homepage, projects, talks, vCard, and SEO now default to project metadata
    • Expanded environment template for additional legal/contact variables
  • Refactor

    • Centralized project metadata system powering site config, routes, SEO, vCard, and plain-text endpoints (security.txt, humans.txt)

Review Change Stack

@toddeTV toddeTV self-assigned this May 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 04c796f6-2a60-4959-ac3c-f8652526b350

📥 Commits

Reviewing files that changed from the base of the PR and between ac04e25 and 0efa252.

📒 Files selected for processing (1)
  • app/utils/buildVCard.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/utils/buildVCard.ts

📝 Walkthrough

Walkthrough

Centralizes project metadata: adds typed contracts and a raw config, provides hydration utilities and a composable, expands legal env/runtime config, and updates pages, components, OG images, vCard builder, footer, and server routes to consume the centralized hydrated metadata.

Changes

Metadata System Implementation and Adoption

Layer / File(s) Summary
Project Metadata Data Model
project-metadata.config.ts
ProjectMetadata and related interfaces define raw and hydrated metadata shapes; default raw projectMetadataConfig exported.
Metadata Hydration and Utilities
shared/utils/project-metadata.ts
getProjectMetadata() returns raw config; prepareProjectMetadata(socials) filters/normalizes socials, selects primary contacts, deduplicates featured profiles, and returns hydrated metadata.
Environment Variables and Nuxt Configuration
.env.example, nuxt.config.ts
Adds legal env placeholders; config now sources SEO/site/schema.org values from projectMetadata; introduces additional runtimeConfig.public.legal* fields; rewires routeRules to metadata-driven paths; extends build-time env validation.
App-Level Metadata Composable
app/composables/useProjectMetadata.ts
New composable loads and caches hydrated metadata (from Content socials) for app-wide consumption.
Schema.org Person Identity
app/app.vue
Derives Schema.org Person sameAs and email from hydrated projectMetadata instead of querying socials directly.
OG Image Components
app/components/OgImageComponents/OgImageFooter.vue, app/components/OgImageTemplate/OgImageDefault.takumi.vue, app/components/OgImageTemplate/OgImageHome.takumi.vue
OG image title/description/footer now resolve from projectMetadata with computed fallbacks instead of hardcoded defaults.
Legal Content Components and Pages
app/components/content/LegalAuthorName.vue, app/components/content/LegalOccupation.vue, app/components/content/LegalContactInfo.vue, app/components/content/LegalRepositoryLink.vue, content/pages/legal-notice.md, content/pages/privacy-policy.md
Adds components that render legal name/occupation/contact/repository from runtime config or project metadata; markdown pages use placeholders for legal values.
Site Footer Component
app/components/layout/SiteFooter.vue
Footer now sources featured socials, author name, legal/privacy/repository links from projectMetadata and runtime config; removes previous async socials query.
Page-Level Data Loading and SEO
app/pages/index.vue, app/pages/projects/index.vue, app/pages/talks/index.vue, app/pages/vcard.vue
Pages fetch projectMetadata via useProjectMetadata() concurrently and derive SEO/OG/UI strings from computed metadata values.
vCard Utility Generalization
app/utils/buildVCard.ts
Adds VCardProjectMetadata and updates buildVCard() to accept project metadata and escape/compose vCard fields from that metadata.
Server Route Metadata Integration
server/routes/.well-known/security.txt.get.ts, server/routes/humans.txt.get.ts
Routes now build responses from getProjectMetadata() / prepareProjectMetadata() instead of static JSON import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • toddeTV/todde.tv#28: Both PRs modify app/pages/vcard.vue and app/utils/buildVCard.ts to switch vCard data sourcing to use useProjectMetadata() and extend buildVCard to accept hydrated project metadata.
  • toddeTV/todde.tv#37: Both PRs refactor server/routes/humans.txt.get.ts and server/routes/.well-known/security.txt.get.ts to generate output from getProjectMetadata()/prepareProjectMetadata() instead of static project.config.json.
  • toddeTV/todde.tv#20: Both PRs change landing-page data/SEO wiring to use useProjectMetadata() for dynamic author/SEO content.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: centralizing project metadata and moving legal page data to environment variables, which aligns with the substantial refactoring across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
app/utils/buildVCard.ts (1)

58-60: ⚡ Quick win

Document the new projectMetadata parameter in JSDoc.

The function signature changed, but the docblock still starts from fixed. Add @param projectMetadata for accurate usage/docs.

As per coding guidelines, "Brief JSDoc on all functions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/utils/buildVCard.ts` around lines 58 - 60, The JSDoc for buildVCard is
outdated after the signature change: add a new `@param` projectMetadata entry
above the function (in the buildVCard docblock) describing the
VCardProjectMetadata parameter and its purpose/expected contents so the docs
match the signature; keep the existing `@param` for fixed and ensure the brief
JSDoc follows the project's style (one-line description plus `@param` tags).
shared/utils/project-metadata.ts (1)

21-39: ⚡ Quick win

Add brief JSDoc to helper utilities.

The helper functions in this block are undocumented; add one-line JSDoc comments for consistency with repository standards.

As per coding guidelines, "Brief JSDoc on all functions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shared/utils/project-metadata.ts` around lines 21 - 39, Add one-line JSDoc
comments to each helper in this block: isMailtoUrl, isPhoneUrl, isProfileUrl,
removeMailtoPrefix, and dedupeUrls. For each function add a brief description
(one sentence) and document the parameters/return types concisely (e.g., `@param`
url string, `@returns` boolean/string/ string[]), and reference the constants
MAILTO_PREFIX and TEL_PREFIX in the isMailtoUrl/isPhoneUrl docs where relevant;
keep comments short and consistent with existing file style.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/pages/vcard.vue`:
- Around line 122-127: Replace the raw <img> used for the QR with the project's
image component: change the <img v-if="qrDataUrl" ... :src="qrDataUrl"> to a
<NuxtImg> with the same bindings (keep v-if="qrDataUrl", :alt="`QR code encoding
a vCard for ${authorName}`", and use src bound to qrDataUrl) and preserve the
class="h-full w-full rounded-lg"; ensure the component name <NuxtImg> is used
(and imported/available via `@nuxt/image` per project setup) so the QR image
follows the project's image-component rule.

In `@app/utils/buildVCard.ts`:
- Around line 71-72: The N: field currently injects raw components
(projectMetadata.author.lastName and .firstName) which can contain
semicolons/commas/backslashes/newlines; call escapeVCardValue on each name
component (e.g., escapedLast = escapeVCardValue(projectMetadata.author.lastName)
and escapedFirst = escapeVCardValue(projectMetadata.author.firstName)) and then
compose the N: line using those escaped variables (preserving the
semicolon-separated order and trailing empty components); update the code that
builds the `N:` line in buildVCard.ts to use these escaped values.

---

Nitpick comments:
In `@app/utils/buildVCard.ts`:
- Around line 58-60: The JSDoc for buildVCard is outdated after the signature
change: add a new `@param` projectMetadata entry above the function (in the
buildVCard docblock) describing the VCardProjectMetadata parameter and its
purpose/expected contents so the docs match the signature; keep the existing
`@param` for fixed and ensure the brief JSDoc follows the project's style
(one-line description plus `@param` tags).

In `@shared/utils/project-metadata.ts`:
- Around line 21-39: Add one-line JSDoc comments to each helper in this block:
isMailtoUrl, isPhoneUrl, isProfileUrl, removeMailtoPrefix, and dedupeUrls. For
each function add a brief description (one sentence) and document the
parameters/return types concisely (e.g., `@param` url string, `@returns`
boolean/string/ string[]), and reference the constants MAILTO_PREFIX and
TEL_PREFIX in the isMailtoUrl/isPhoneUrl docs where relevant; keep comments
short and consistent with existing file style.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 0784a532-0e03-4cbc-a708-4f2de211f3f7

📥 Commits

Reviewing files that changed from the base of the PR and between bbeafda and ac04e25.

📒 Files selected for processing (24)
  • .env.example
  • app/app.vue
  • app/components/OgImageComponents/OgImageFooter.vue
  • app/components/OgImageTemplate/OgImageDefault.takumi.vue
  • app/components/OgImageTemplate/OgImageHome.takumi.vue
  • app/components/content/LegalAuthorName.vue
  • app/components/content/LegalContactInfo.vue
  • app/components/content/LegalOccupation.vue
  • app/components/content/LegalRepositoryLink.vue
  • app/components/layout/SiteFooter.vue
  • app/composables/useProjectMetadata.ts
  • app/pages/index.vue
  • app/pages/projects/index.vue
  • app/pages/talks/index.vue
  • app/pages/vcard.vue
  • app/utils/buildVCard.ts
  • content/pages/legal-notice.md
  • content/pages/privacy-policy.md
  • nuxt.config.ts
  • project-metadata.config.ts
  • project.config.json
  • server/routes/.well-known/security.txt.get.ts
  • server/routes/humans.txt.get.ts
  • shared/utils/project-metadata.ts
💤 Files with no reviewable changes (1)
  • project.config.json

Comment thread app/pages/vcard.vue
Comment thread app/utils/buildVCard.ts Outdated
@toddeTV toddeTV merged commit b2b0a14 into main May 19, 2026
5 checks passed
@toddeTV toddeTV deleted the refactor/project-metadata-centralization branch May 19, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant