Add a library component
add_componentInsert a component from the site's shared library into one or more existing pages, INSTEAD of hand-writing the markup yourself — the classes are already styled and themed to this site's colours. Choices: sc-page-title (the page's one ), sc-gallery (cross-fading photo reel — needs 'images'), sc-info-tiles (title + picture + text sections — needs 'tiles'), sc-instructions (numbered/titled steps, optionally with a button each — needs 'tiles'), sc-event (one dated thing: a class, a session, an opening — needs 'title'), sc-btn (a link styled as a button — needs 'label'). NOT offered: sc-header/sc-footer (the site's own shell already emits those) or sc-hero (placed once, on the home page, by the site's own build). 'anchor' says where it goes: {"type": "heading", "value": "", "position": "after"} (default), {"type": "id", "value": "", "position": "after"}, {"type": "main_end"} (append at the end of the page), or {"type": "replace", "value": "<class of an existing sc-* block>"}. 'pages' is "all" or a list of paths from list_site_files. A page whose anchor doesn't match comes back in 'findings' with what's wrong and the fix — other pages in the same call still get the component. Follow with publish_site.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| slug | Yes | ||
| pages | No | "all", or an array of page paths, e.g. ["index.html", "about.html"] | |
| anchor | Yes | ||
| fields | Yes | Component-specific content. sc-page-title: {text, eyebrow?}. sc-gallery: {images: [{src, alt}]}. sc-info-tiles: {tiles: [{title, img?, alt?, text}]}. sc-instructions: {title?, intro?, tiles: [{title?, body, img?, alt?, button?: [label, href]}]}. sc-event: {title, img?, meta?: [{label, value}], desc?, rsvp_href?, rsvp_label?}. sc-btn: {label, href}. |