Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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. |