orestaty

Crates.ioorestaty
lib.rsorestaty
version1.0.0
sourcesrc
created_at2024-06-17 11:35:54.067719
updated_at2024-08-29 12:04:23.806241
descriptionHTML-centered handlebars-based static site generator
homepage
repositoryhttps://github.com/InfiniteCoder01/OreStaty/
max_upload_size
id1274353
size81,098
InfiniteCoder (InfiniteCoder01)

documentation

README

OreStaty

OreStaty - HTML-centered handlebars-based static site generator

Using it as a library

Look at main.rs to see how you can use OreStaty as a library in your Rust projects

CLI

Subcommands:

  • init
  • build (assumed by default)
  • theme-to-css [-o/--output output.css] Flags:
  • -p/--path - specify project path (current directory by default)
  • -o/--output - specify output directory (dist by defalt)

Directory structure

Only "src" directory is mandatory. All files in it are gonna be built (.html/.htm/.hbs - handlebars, .md/.markdown - markdown + handlebars, .css/.scss/.sass - SASS) All files in "static" directory are gonna be copied to output directory In "plugins" directory you can put:

  • Handlebars templates for rendering HTML and Markdown
  • rhai helper scripts for Handlebars (see percent.rhai and page.md; Note: Handlebars helpers have scope in form of example_percent, not example.percent. Also, in Markdown you might need to escape quotes in string params)

All files in plugins directory get scope. For example, plugins/theme/template.html will be registered as Handlebars template with name theme.template "plugins" is a load path for SASS (if you put bulma-css into this directory, you can import it with @import bulma/bulma).

All files/directories showcased in this example of a directory tree:

project_directory
├─src
│  ├─index.html
│  ├─page.md
│  └─global.scss
│
├─static
│  ├─image.png
│  └─robots.txt
│
├─plugins
│  ├─example.rhai
│  └─bulma
│      ├─css
│      ├─sass
│      ├─versions
│      ├─bulma.scss
│      ├─LICENSE
│      ├─package.json
│      └─README.md
│
└─dist (auto generated)

Config

You can configure your site in config.toml Here is an example showcasing all possible config options:

default_template = "template"
default_markdown_template = "template"
code_highlight_theme = "InspiredGitHub"

TODO

Some stuff to do:

  • Dev server with file watching
  • Cache stuff
  • Parallelization
Commit count: 10

cargo fmt