The official SDK for building MicroPress themes.
npm install -g @micropress/theme-sdkOr use locally in your project:
npm install --save-dev @micropress/theme-sdk# Create a new theme
micropress-theme init my-theme
cd my-theme
# Install dependencies
npm install
# Develop
micropress-theme validate # Check structure
micropress-theme build # Build to dist/
micropress-theme package # Create ZIP
# Output: my-theme-1.0.0.zip ready for upload| Command | Description |
|---|---|
micropress-theme init <name> |
Create a new theme project |
micropress-theme build |
Build the theme for distribution |
micropress-theme validate |
Validate theme structure |
micropress-theme package |
Create distributable ZIP |
import { defineTheme, html, css } from '@micropress/theme-sdk';
import type { HeaderDTO } from '@micropress/theme-sdk';
export default defineTheme({
config: {
id: 'my-theme',
name: 'My Theme',
version: '1.0.0',
},
renderers: {
header: {
render: (data: HeaderDTO) => html`
<header class="my-header">
<a href="/">${data.siteName}</a>
</header>
`.html,
styles: () => css`
.my-header {
padding: 1rem 2rem;
border-bottom: 1px solid #eee;
}
`,
},
},
});The registry/registry.json file contains community themes. To add your theme:
- Create a GitHub release with your theme ZIP
- Fork this repository
- Add your theme to
registry/registry.json - Submit a Pull Request
See Publishing for details.
See CONTRIBUTING.md for guidelines.
MIT