roc/examples/static-site-gen
2022-09-19 21:12:48 -04:00
..
input static-site-gen: New example using lorem ipsum content 2022-09-05 20:46:53 +01:00
output static-site-gen: add some CSS 2022-09-05 21:13:37 +01:00
platform Fix type mismatch in exit code 2022-09-19 21:12:48 -04:00
.gitignore static-site-gen: move assets to output folder 2022-09-04 16:43:05 +01:00
README.md static-site-gen: Replace hello.txt with a copy of John Gruber's website 2022-09-04 16:41:43 +01:00
static-site.roc static-site-gen: add some CSS 2022-09-05 21:13:37 +01:00

Static site generator

This is an example of how you might build a static site generator using Roc. It searches for Markdown (.md) files in the input directory, inserts them into a HTML template defined in Roc, and writes the result into the corresponding file path in the output directory.

To run, cd into this directory and run this in your terminal:

If roc is on your PATH:

roc run static-site.roc input/ output/

If not, and you're building Roc from source:

cargo run -- static-site.roc -- input/ output/

The example in the input directory is a copy of the 2004 website by John Gruber, introducing the Markdown format. https://daringfireball.net/projects/markdown/