astro-ghostcms/packages/astro-ghostcms-rendercontent
create-issue-branch[bot] 27241192af
feat: Chore: Migrate from Render content Util and `<Fragment set:html />` to `astro-remote` (#86)
Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com>
Co-authored-by: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com>
Co-authored-by: Adam Matthiesen <amatthiesen@outlook.com>
2024-03-07 23:29:02 -08:00
..
examples Linted the entire project. no linting errors now 2024-02-15 04:49:02 -08:00
lib Linted the entire project. no linting errors now 2024-02-15 04:49:02 -08:00
CHANGELOG.md chore: update versions 2024-03-07 14:38:11 +00:00
LICENSE Massive Repo Cleanup and organization 2024-02-14 05:17:01 -08:00
README.md feat: Chore: Migrate from Render content Util and `<Fragment set:html />` to `astro-remote` (#86) 2024-03-07 23:29:02 -08:00
index.ts Linted the entire project. no linting errors now 2024-02-15 04:49:02 -08:00
package.json chore: update versions 2024-03-07 14:38:11 +00:00

README.md

Astro GhostCMS Content API HTML Processor

NOTE: This package is no longer in use - Please switch to astro-remote

Render remote GhostCMS HTML in Astro with full control over the output.

Powered by ultrahtml.

Rendering Remote Content

The most basic function of astro-ghostcms-rendercontent is to convert a string of HTML to Astro friendly HTML. Use the GhostRender component.

---
import { GhostRender } from "@matthiesenxyz/astro-ghostcms-rendercontent";
---

<GhostRender content={post.html} />

Customization

GhostRender allows full control over the rendering of output. The components option allows you to replace a standard HTML element with a custom component.

---
import { GhostRender } from "@matthiesenxyz/astro-ghostcms-rendercontent";
import Title from '../components/Title.astro';
---

<!-- Render <h1> as custom <Title> component -->
<GhostRender content={post.html} components={{ h1: Title }} />

For examples on how to setup custom components check examples