https://github.com/ndesmic/react-ssg
Simple 20 line react SSG
https://github.com/ndesmic/react-ssg
Last synced: 8 months ago
JSON representation
Simple 20 line react SSG
- Host: GitHub
- URL: https://github.com/ndesmic/react-ssg
- Owner: ndesmic
- Created: 2020-11-16T19:03:45.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-10T07:13:11.000Z (over 4 years ago)
- Last Synced: 2024-08-04T01:26:49.155Z (over 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 72
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-list - react-ssg
README
React-SSG
=========
NextJS and Gatsby can be overkill, this is simple 20-line example of doing react static-site generation using [htm](https://github.com/developit/htm) instead of transpilation.
## How to use:
Included are two flavors, react and preact. While both are included, if you use this as a base you'll probably only want to use one (and I'd recommend Preact because it's much smaller).
```
node renderers/htm-react-renderer.js
```
or
```
node renderers/htm-preact-renderer.js
```
| Option | Description | Default |
|--------|-------------|---------|
| `-o` | output directory name | "./output/" |
| `-t` | template directory name | "./templates/" |
Files are exported using the same name to the output folder. Files with preceeding `_` are partials and will not be exported. You can use these for layouts and such. Path for folders must end with `/`.
This is designed to be an example you build on, it should be easy to hook up other CLI tools to render other assets.