···44section: "core-concepts"
55---
6677-In general, if a library can return a String, you can use it to generate pages with Maudit.
77+In general, if a library can return a `String` or a `Vec<u8>`, you can use it to generate pages with Maudit.
8899Through crate features, Maudit includes built-in helper methods and traits implementation for popular templating libraries.
1010···2828}
2929```
30303131-Maudit implements the `Render` trait for assets, such as scripts, styles, and images, allowing one to use them directly in Maud templates.
3131+Maudit implements the `Render` trait for scripts and styles, allowing one to use them directly in Maud templates.
32323333```rs
3434use maud::{html, Markup};
···39394040impl Route for Index {
4141 fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
4242- let logo = ctx.add_image("./logo.png");
4242+ let style = ctx.add_style("style.css");
43434444 html! {
4545- (logo) // Will generate <img src="IMAGE_PATH" width="IMAGE_WIDTH" height="IMAGE_HEIGHT" loading="lazy" decoding="async" />
4545+ (style) // Will render to a <link> tag for the CSS file
4646 }
4747 }
4848}
···5555maud = "0.27"
5656```
57575858-The `maud` feature is enabled by default. If you have disabled default features, enable it manually:
5858+The `maud` feature is enabled by default. If you have disabled default features, you can enable it manually:
59596060```toml
6161maudit = { version = "0.6", features = ["maud"] }
+1-1
website/content/news/maudit-compile-time.md
···71717272This is my CMS at home, don't judge me. More seriously, you could imagine loading pages from an actual CMS, a database, a `.json` file etc. And thus, combined with runtime templating, be able to add an infinite amount of pages without ever recompiling.
73737474-Maudit is a library, not a framework. Make it work for you!
7474+The posibilities are infinite here, perhaps your website will never need recompilation again, who knows.
+42
website/content/news/maudit-library.md
···11+---
22+title: "The court's library, not its king"
33+description: "Maudit is a library, not a framework"
44+author: The Maudit Team
55+date: 2025-10-09
66+---
77+88+The average static site generator (SSG) works like this:
99+1010+- You install some sort of package or binary in your project (ex: `astro`, `@11ty/eleventy`, `gatsby`, etc) or globally (ex: `hugo`, `zola`)
1111+- You project may contain some sort of special folders, `src/pages`, `_includes`, etc. Or at least, has a convention for how to define your pages (which might just be a bunch of `.md` files or configuration based, that's ok)
1212+- Oftentimes, you'll have a config file (`gatsby.config.js`, `astro.config.js`, `hugo.toml` etc) to define some settings.
1313+1414+Then, to build your website you'll run a `build` command, running an internal build pipeline of the framework, transforming your pages, configuration etc, into nice `.html` files. Put more bluntly, you provide things to the framework, it does some things with it and so it goes. Great, nice.
1515+1616+Maudit instead provides an alternative model: **You call Maudit, it does not call you.** A Maudit project is a Rust project, you generate your website by running your normal Rust project's generated binary that uses Maudit as a library and call its methods.
1717+1818+## The Mantle is Thine
1919+2020+Pages in Maudit projects are normal Rust structs, you can import them in other files, provide them properties, implement methods on them etc. To get the HTML of a single page in SSG frameworks is sometimes impossible, but in Maudit, you can import the page and call [`.build()`](https://docs.rs/maudit/latest/maudit/route/trait.FullRoute.html#method.build), it straight up just works!
2121+2222+This philosophy applies to all of Maudit, for instance to render remote Markdown using Maudit's Markdown pipeline (providing syntax highlighting, components, shortcodes, etc), you import [`render_markdown`](https://docs.rs/maudit/latest/maudit/content/markdown/fn.render_markdown.html) and pass it some content and options. The code on the homepage is highlighted using [`highlight_code`](https://docs.rs/maudit/latest/maudit/content/fn.highlight_code.html), which is the exact same function that `render_markdown` will use for highlighting as well, and so on.
2323+2424+It is intended for it to be possible to build your own static website generators based on all these APIs, [we even have on a guide on how to do it!](https://maudit.org/docs/library/), or if you're 99% of people, the [`coronate()`](https://docs.rs/maudit/latest/maudit/fn.coronate.html) function (the ["entrypoint"](https://maudit.org/docs/entrypoint/)) act as both the reference implementation of how to build pages, bundle assets, process images etc and also as the function the average Maudit project would call.
2525+2626+## For What Quest We Stand Here
2727+2828+These needs might seem niche, but it was actually born out of real pain points we've hit in current offerings. Most notably, for our own projects we often ran into the need to have access to the structured content the framework provide, but outside of the framework's blessed paths which proved to be cumbersome or sometimes totally impossible.
2929+3030+In Maudit, it is totally possible to use [content sources](https://maudit.org/docs/content/) outside of pages or outside the site's generation totally, it's cool! (we think!)
3131+3232+## Tis but a Scratch
3333+3434+Of course, this comes with some trade-offs. Being a library probably means it’s never going to feel as easygoing as something like Eleventy or Astro. You probably won’t be able to just toss a few Markdown files into a folder and call it a day. (One day, though, perhaps)
3535+3636+That said, we think that’s okay. We’ll do our best to make Maudit as friendly as we can, and the docs as clear and welcoming as possible. But if you end up needing something simpler to get going with, that’s fine too. No hard feelings.
3737+3838+---
3939+4040+We’re very excited to see what people build with Maudit! Hopefully, the flexibility of Maudit empowers and motivate you to create websites that fits your exact and precise needs.
4141+4242+If you have any questions, feedback, or just want to say hi, feel free to [join our Discord](https://maudit.org/discord) or [open an issue or discussion on GitHub](https://github.com/bruits/maudit)!