sonata/
lib.rs

1//! ## sonata
2//!
3//! The static site generator.
4//!
5//! For the minimal directory layout:
6//!
7//! ```ignore
8//! .
9//! ├── sonata.toml
10//! └── posts
11//!     └── 2024-01-01-hello-world.md
12//! ```
13//!
14//! The full configuration:
15//!
16//! ```toml
17//! # my-blog/sonata.toml
18//! title = "sonata"         # The title of the site.
19//!
20//! # Default values of the optional fields.
21//! # --------------------------------------
22//! favicon = "favicon.svg"   # The path to the favicon.
23//! out = "out"               # The path to the output directory.
24//! posts = "posts"           # The path to the posts.
25//! public = "public"         # The path to the public directory.
26//! templates = "templates"   # The path to the templates.
27//!
28//! # Theme could also be a folder:
29//! #
30//! # - [theme]
31//! #   - index.css (optional)
32//! #   - post.css  (optional)
33//! #   - theme.css (optional)
34//! theme = "theme.css"
35//! ```
36//!
37//! ## LICENSE
38//!
39//! GPL-3.0-only
40
41mod app;
42pub mod cmd;
43mod manifest;
44mod post;
45mod utils;
46
47pub use self::{
48    app::{App, LIVERELOAD_ENDPOINT},
49    manifest::{Manifest, MINIMAL_MANIFEST},
50    post::{Meta, Post, TEMPLATE_POST},
51};
52
53/// The default sonata templates.
54#[derive(rust_embed::RustEmbed)]
55#[folder = "blog/templates"]
56#[include = "*.hbs"]
57pub struct Templates;
58
59#[test]
60fn embed() {
61    assert!(Templates::get("post.hbs").is_some());
62}