A general-purpose high-performance static site generator for MoonBit
moon install justjavac/fus/fus # install the CLI
fus init my-site # scaffold a site
fus run --root my-site --port 8000 # build, serve and watch
fus build --root my-site # output: my-site/_site/---
title: Hello
layout: base
---
# Hello Fus// moon.pkg
import {
"justjavac/fus",
}// main.mbt
async fn main {
let opts = @fus.make_options("my-site", None, None, false, false, true)
let result = @fus.build_site(opts)
println("built \{result.pages} pages")
}| Command | What it does |
|---|---|
| fus init [dir] | Scaffold a new site. |
| fus build | Render the site into _site/. |
| fus check | Validate config, content and templates without writing. |
| fus run | Build, serve and rebuild on change. |
| fus serve | Same as run, for scripts that name the server. |
| fus clean | Remove the output directory and cache. |
| fus version | Print the version. |
| fus help | Print the command list. |
///|
// moon.pkg
import {
"justjavac/fus",
}///|
async fn main {
let opts = @fus.make_options("my-site", None, None, false, false, true)
let result = @fus.build_site(opts)
println("built \{result.pages} pages")
}///|
let result = @fus.build_site_with(
opts,
@fus.FormatRegistry::builtin(),
@fus.ContentRegistry::builtin(),
None,
)fn attr_escape(s : StringView) -> Stringasync fn build_site_with(options : BuildOptions, formats : FormatRegistry, contents : ContentRegistry, engine_env : TemplateEnv?) -> BuildResultfn builtin_layout(layout : StringView) -> Boolfn char_at(s : StringView, index : Int) -> Charasync fn check_site_with(options : BuildOptions, formats : FormatRegistry, contents : ContentRegistry) -> CheckReportfn display_name(lang : StringView) -> Stringasync fn ensure_dir(path : StringView) -> Unitfn extname(path : StringView) -> Stringfn format_date(value : StringView, format : StringView) -> Stringfn format_of_path(path : StringView) -> Stringfn has_any(s : StringView, chars : StringView) -> Boolfn has_prefix(s : String, prefix : StringView) -> Boolfn has_suffix(s : String, suffix : StringView) -> Boolfn has_unclosed_front_matter(text : StringView) -> Boolfn hash(s : StringView) -> Stringfn help(topic? : String?) -> Unitfn highlight_code(code : StringView, lang : StringView) -> Stringfn highlight_html(html : String) -> Stringfn html_escape(s : StringView) -> Stringfn is_document(body : StringView) -> Boolfn join_path(base : String, name : StringView) -> Stringasync fn load_config(root : String, config_path : String?, dest_override : String?, force : Bool) -> Configasync fn load_config_with(root : String, config_path : String?, dest_override : String?, force : Bool, formats : FormatRegistry, contents : ContentRegistry) -> Configfn make_options(root : String, config : String?, dest : String?, force : Bool, drafts : Bool, quiet : Bool) -> BuildOptionsfn minify_html(input : StringView) -> Stringfn normalize_slashes(path : StringView) -> Stringfn parse_double(s : StringView) -> Double?fn prefix_for(lang : StringView, default_lang : StringView) -> Stringasync fn read_text_or(path : StringView, fallback : String) -> Stringfn render_body(body : String, src : StringView, ctx : Json, env : TemplateEnv, registry : ContentRegistry) -> Stringfn render_builtin(layout : StringView, page : Json, body : String, slot : (StringView) -> String) -> (String, String)?fn render_layout(name : StringView, ctx : Json, body_html : StringView, env : TemplateEnv) -> Stringfn render_markdown(text : StringView) -> Stringfn render_source_of(source : StringView, path : StringView, ctx : Json, env : TemplateEnv) -> Stringasync fn resolve_config_path(root : String, config_path : String?) -> Stringfn rfind(s : StringView, needle : StringView) -> Int?fn slice(s : StringView, start : Int, end : Int) -> Stringfn slugify(s : StringView) -> Stringfn split_once(s : StringView, delimiter : Char) -> (String, String)?fn strip_trailing_slash(text : StringView) -> Stringfn theme_signature() -> Stringfn to_int(s : StringView) -> Intfn to_url(path : StringView) -> Stringfn trim(s : StringView) -> Stringfn trim_quotes(s : StringView) -> Stringfn url_to_dest(url : StringView) -> Stringasync fn write_if_changed(path : StringView, content : String) -> BoolInstall
Download zipA general-purpose high-performance static site generator for MoonBit