Slots are named injection points in the HTML template where plugins can insert content.
Slot
Position
Authorable
head-end
Before — for stylesheets, scripts, and meta tags.
no
after-title
Inside , after the title/date row — for article metadata (e.g. book block, review colophon).
no
before-article-end
Inside , before — filled by a partial with slot: before-article-end, for the articles of its folder and the folders beneath it, and by plugins for article addenda.
yes
after-article
Between and — for comments, reactions (NOT part of the article).
no
footer-left
Inside footer, leading position — filled by footer.md or any file with slot: footer-left frontmatter.
yes
footer-end
Inside footer, trailing position — for the auto-injected subscribe form and plugin widgets.
no
body-end
Before
— for scripts that must run after DOM is ready.
no
How slots work
During generation, moss writes HTML comment markers at each slot position:
During the enhance phase, each plugin with the enhance capability returns content for the slots it fills. moss replaces the markers with that content. Unfilled markers are stripped from the final output and never appear in the published HTML.
Multiple plugins can write to the same slot. Their content is concatenated in plugin load order.
EnhanceResult
The enhance hook returns an object mapping slot names to HTML strings: