@nukipa/post-content
v0.2.3
Published
Framework-agnostic processor for Nukipa CMS post bodies — markdown + component markers + citations → HTML + interactive island descriptors.
Downloads
140
Maintainers
Readme
@nukipa/post-content
Framework-agnostic processor for CMS post bodies.
import { renderPostBody, renderSourcesList } from '@nukipa/post-content';
const { html, mounts } = renderPostBody({
body: post.body,
components: post.components,
sources: post.sources,
options: { lang: post.language, postId: post.id }
});What it handles
| Marker / type | Behaviour |
| -------------------- | ----------------------------------------------------- |
| {{fact}}…{{/fact}} | Wrapper stripped, inner text kept |
| {{cite:N}} | Replaced with <sup><a href="#source-N">… after MD |
| {{component:UUID}} | Rendered to HTML; interactive types add to mounts |
| Component types | callout, faq, steps, card, data_table, comparison, process, image, image_carousel, chart, widget, quote, cta, form, contact_form |
CTAs render as a real <a href> (so SEO + no-JS still navigate) plus a
data-island="cta" placeholder — framework adapters attach click tracking
on top via the mounts entry. Lead-gen forms, contact forms, charts,
carousels, and widgets emit data-island="..." placeholders only; the
adapter is responsible for hydration.
Class names
All static blocks use bp-* classes matching the Vue site at
apps/public/. Lift the relevant CSS rules from
apps/public/app/components/BlogArticle.vue (scoped style block) into
your tenant site's stylesheet — keys remain stable.
Peer deps
marked@^17 — bring your own. The package uses one shared instance
internally for component-content rendering and the host's instance via
renderPostBody for the outer body.
