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: 8 days 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 (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-17T23:17:53.000Z (27 days ago)
- Last Synced: 2024-10-20T09:56:25.121Z (24 days ago)
- Topics: roc-lang, ssg, static-site-generator
- Language: Roc
- Homepage: https://lukewilliamboswell.github.io/basic-ssg/
- Size: 180 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- 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. If 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 easy to add.
- Arm64 MacOS
- Arm64 Linux
- x64 MacOS
- x64 Linux## 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 "https://github.com/lukewilliamboswell/basic-ssg/releases/download/[REPLACE WITH LATEST RELEASE VERSION].tar.br" }import pf.SSG
import pf.Types exposing [Args, toRelPath]
import pf.Html exposing [html, head, body, div, text, a, ul, li, link, meta]
import pf.Html.Attributes exposing [httpEquiv, content, href, rel, lang, class, title]
import "style.css" as styleCss : Strmain : Args -> Task {} _
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.
```
$ nix develop
$ roc build.roc
$ roc dev --prebuilt-platform example/main.roc -- example/content/ example/output/
```You can generate a new package for distribution using `roc build.roc --release --bundle`