Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kalabasa/compose-html
Yet another static site generator
https://github.com/kalabasa/compose-html
Last synced: about 2 months ago
JSON representation
Yet another static site generator
- Host: GitHub
- URL: https://github.com/kalabasa/compose-html
- Owner: Kalabasa
- Created: 2022-12-02T18:30:41.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T13:43:29.000Z (6 months ago)
- Last Synced: 2024-06-29T13:28:03.978Z (6 months ago)
- Language: TypeScript
- Size: 893 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# compose-html
Yet another static site generator.
## A simple example
### Source files
```html
{attrs.title}
``````html
Hello, world!
How's it going?
```
### Output file
```html
Hello
Hello, world!
How's it going?
```## Status
This project is in very low maintenance mode. I'm looking to migrate to Astro anyway.
## Syntax
| Example | Description |
|-|-|
| `` | Run script in the client (normal script). |
| `` | Run script at build time and render the return value or output in place. |
| `<script static>` | Run script at build time (once per file). |
| `` return attrs.myVar `` | In a render script, use `attrs` to access current component's attributes. |
| `` return children.length `` | In a render script, use `children` to access current component's children for processing. (But use `<slot>` for rendering) |
| `` return html`<div>` `` | In a render script, use the `html` tag to render HTML (processed further by compose-html). |
| `` return raw`<div>` `` | In a render script, use the `raw` tag to render unprocessed HTML. |
| `` `<div ${spreadAttrs(map)}>` `` | In a render script, use the `spreadAttrs` function to render multiple attributes. |