Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukewilliamboswell/basic-ssg
Static Site Generation for roc
https://github.com/lukewilliamboswell/basic-ssg
roc-lang ssg static-site-generator
Last synced: about 2 months ago
JSON representation
Static Site Generation for roc
- Host: GitHub
- URL: https://github.com/lukewilliamboswell/basic-ssg
- Owner: lukewilliamboswell
- License: upl-1.0
- Created: 2024-04-24T05:37:28.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-17T09:06:19.000Z (about 2 months ago)
- Last Synced: 2024-12-17T10:18:04.613Z (about 2 months ago)
- Topics: roc-lang, ssg, static-site-generator
- Language: Roc
- Homepage: https://lukewilliamboswell.github.io/basic-ssg/
- Size: 168 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- roc-awesome - lukewilliamboswell/basic-ssg
README
# Static Site Generatation for Roc
A platform for Static Site Generation. Parse a directory of markdown files, and then transform the content using [roc](https://www.roc-lang.org) into an html site that is ready to be served from a web server or [CDN](https://en.wikipedia.org/wiki/Content_delivery_network).
**Supported Targets**
The following targets are included in each release.
- MacOS aarch64 and x86_64
- Linux aarch64 and x86_64If you would like an additional target, let me know because it's probably supported by [rustc](https://doc.rust-lang.org/beta/rustc/platform-support.html) and very easy to add.
## Getting Starting
Ensure you have [installed the roc cli](https://www.roc-lang.org/install).
Use the latest [release](https://github.com/lukewilliamboswell/basic-ssg/releases) of this platform by replacing the URL in the header.
```roc
app [main!] { pf: platform "" }import pf.SSG
import pf.Types exposing [Args]
import pf.Html exposing [div, link, text, a, html, head, body, meta, ul, li]
import pf.Html.Attributes exposing [class, httpEquiv, href, rel, content, lang, title]main! : Args => Result {} _
main! = \{ inputDir, outputDir } ->
# ... use SSG.files!, SSG.parseMarkdown!, and SSG.writeFile! here to generate site
```## Platform Development
Ensure you have [roc](https://www.roc-lang.org/install) & [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) installed.
Using nix (optional)
```
$ nix develop
``````
$ roc build.roc
$ roc example/main.roc -- example/content/ example/output/
```You can generate a new package for distribution using `roc build.roc --release --bundle`