feat: dynamic OG meta tag generation on build (#64)#99
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add single-quote escaping (') to escapeHtml to prevent XSS via attribute injection in single-quoted HTML attributes - Refactor ogImage block to handle og:image and twitter:image independently, so twitter:image is always replaced or injected when ogImage is configured, even when og:image already exists in the HTML Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b8af7c5 to
5a7e5a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ogMetaPlugin()Vite plugin that readsmonitor-forge.config.jsonat build/dev time and injects config values intoindex.htmlOG meta tags (og:title,og:description,twitter:title,twitter:description,<title>)ogImagefield toBrandingSchema— when set,og:imageandtwitter:imagetags are injected; when absent, any existing image tags are strippedvite.config.tsalongside the existingapiDevPluginTest plan
npx vitest run forge/— 372 tests pass (13 new tests forog-meta-plugin)npx tsc --noEmit— zero new errors introduced (pre-existingsrc/App.tsgenerated-manifest errors andapi/proxy/v1error are unrelated and existed onmain)&,",<,>in name/descriptionogImageinjection and removal both testedCloses #64
🤖 Generated with Claude Code