These recipes wire Patina into build-time checks for Markdown sites. They are intentionally in-repo examples, not standalone npm packages.
All examples assume one of these authentication paths:
export PATINA_API_KEY=...
# or tell the example scripts to use a logged-in local CLI backend:
export PATINA_BACKEND=codex-cli
# optional: use an installed binary instead of `npx --yes patina-cli`
export PATINA_BIN=patinaFor CI, prefer score gates over automatic rewrites:
patina --lang en --backend codex-cli --score --exit-on 30 docs/**/*.mdThe public playground is documented in playground.md and targets patina.vibetip.help. It rewrites and scores text through a same-origin serverless function; for CI-style gating of a static site, use the CLI flows on this page instead.
Use a small Node helper to score content and write a Hugo data file:
node examples/integrations/hugo/scripts/patina-scores.mjs content/posts data/patina-scores.jsonThen render a badge in a template or post body:
{{</* patina-score path="content/posts/launch.md" */>}}
Files:
examples/integrations/hugo/scripts/patina-scores.mjsexamples/integrations/hugo/layouts/shortcodes/patina-score.html
Astro integrations can fail the build before pages render. The example integration scans Markdown under src/content and runs patina --score --exit-on 30.
// astro.config.mjs
import patinaAudit from './examples/integrations/astro/patina-audit-integration.mjs';
export default {
integrations: [patinaAudit({ contentDir: 'src/content', lang: 'en', threshold: 30 })],
};File: examples/integrations/astro/patina-audit-integration.mjs
The Next.js example exports a remark plugin that scores the Markdown text during MDX compilation and emits a VFile warning when the threshold is exceeded. Teams can decide whether warnings fail CI.
// next.config.mjs
import createMDX from '@next/mdx';
import patinaRemark from './examples/integrations/nextjs/remark-patina-score.mjs';
const withMDX = createMDX({
options: {
remarkPlugins: [[patinaRemark, { lang: 'en', threshold: 30 }]],
},
});
export default withMDX({ pageExtensions: ['js', 'jsx', 'md', 'mdx'] });File: examples/integrations/nextjs/remark-patina-score.mjs
- Keep v1 in-repo; do not publish a package until at least one real site uses the stencil.
- Do not send private drafts to third-party backends from CI unless the project owner opted in.
- Use
--exit-onfor gating and leave rewrites as a local author action.