You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 581ff28
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: frontend/purestack.studio/guides/extending/plugins.mdx
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,13 +91,15 @@ The badge appears on the page. Change its `tone` in `plugins/site.ts` while the
91
91
92
92
## Standard plugins
93
93
94
-
PureStack includes three plugins automatically in `build`, `serve`, and `publish`:
94
+
PureStack includes five plugins automatically in `build`, `serve`, and `publish`:
95
95
96
96
| Package | Factory | Provides |
97
97
| --- | --- | --- |
98
98
|`@purestack/ts-components`|`componentsPlugin()`| Standard components, icons, and component styles |
99
-
|`@purestack/ts-theme`|`themePlugin()`| The `doc` and `splash` templates, generated theme CSS, and theme switching |
100
-
|`@purestack/ts-page-scripts`|`pageScriptsPlugin()`| Auth hint, consent and analytics, menus, navigation, code copying, search, and TOC runtimes |
99
+
|`@purestack/ts-theme`|`themePlugin()`| The `doc` and `splash` templates, generated theme CSS, favicons, and theme switching |
100
+
|`@purestack/ts-page-scripts`|`pageScriptsPlugin()`| Auth hint, consent and analytics, menus, navigation, code copying, search, TOC, Tabs, and Modal runtimes |
101
+
|`@purestack/ts-highlight`|`highlightPlugin()`| Shiki or highlight.js code highlighting |
102
+
|`@purestack/ts-pagefind`|`pagefindPlugin()`| Full-build and lazy development search indexing |
101
103
102
104
The stylesheet provider initializes before component factories, then all config hooks run in plugin order. Names do not affect initialization. Components belong to each build, so hooks can override them through `context.components`. The theme and page runtime plugins supply head templates that run before the selected page template, preserving its ability to inspect or change the completed head. The lifecycle hook set is unchanged.
This keeps the layouts and components while omitting the page runtimes. Theme switching belongs to the theme plugin; component-specific Tabs and Modal embeds still follow the page's `embed` settings. Without the theme plugin, another plugin must supply your page templates and any CSS output you need.
117
+
This keeps the layouts and components while omitting page runtimes, code highlighting, and search indexing. Theme switching and favicon generation belong to the theme plugin. Tabs and Modal scripts belong to the page scripts plugin, including automatic component embeds and explicit frontmatter settings. Without the theme plugin, another plugin must supply your page templates and any CSS output you need.
116
118
117
119
An explicitly listed standard plugin replaces the automatic instance by name and keeps its initialization position. You can also use `createDefaultPlugins()` to obtain the complete set. In programmatic builds, use `options.defaultPlugins` alongside `options.plugins`.
118
120
121
+
The highlighting plugin selects the configured backend. Configure native backend factories through `highlightPlugin({ createShiki, createHighlightJs })`, or supply `markdown.createHighlighter(config)` for a different engine. The generic provider returns `{ codeToHtml(code, lang?) }`. Ordinary providers override the default without constructing it; per-language `markdown.resolveHighlighter` callbacks retain precedence.
122
+
123
+
The Pagefind plugin supplies a `search` provider. To use another engine, replace `purestack:pagefind` or disable the default set and install your own provider. The builder supplies excluded output paths and the rendered-page list for lazy requests, and manages invalidation on edits and deletions. Sitemap and robots generation remain built in.
124
+
119
125
## How the config loads
120
126
121
127
-**Where it lives.** The CLI looks for `purestack.config.ts` in the folder passed to `--content`. It must default-export `defineConfig({ plugins: [...] })`.
0 commit comments