···11# Benchmarks
2233This directory contains various benchmarks for Maudit.
44+55+## On compile times
66+77+All the numbers in these benchmarks only include the **running time** of the benchmark. [Maudit operates on the idea that your content and assets change way more often than any parts that would require re-compilation](https://maudit.org/docs/philosophy/#your-website-changes-less-often-than-its-content) (static templates, pretty much anything in a `*.rs` file) and as such expect that the vast majority of your builds won't require compilation.
88+99+This is not a gotcha moment or anything we're trying to hide: **With compilation times included, Maudit is slower than most static site generators.**
+9-31
benchmarks/md-benchmark/README.md
···99To run the benchmark, execute the following command:
10101111```sh
1212-cargo run --release
1313-```
1414-1515-By default, this will build 1000 pages. You can change the number of pages to build by using the `MARKDOWN_COUNT` environment variable:
1616-1717-```sh
1818-MARKDOWN_COUNT=4000 cargo run --release
1919-```
2020-2121-Valid values for `MARKDOWN_COUNT` are 250, 500, 1000, 2000, and 4000.
2222-2323-Note that `cargo run` has a certain overhead, as such if checking the total time, it's more useful to run the compiled binary (`target/release/maudit-benchmark`) directly
2424-2525-## `cargo bench`
2626-2727-All 5 benchmarks can be run at once using the `cargo bench` command:
2828-2929-```sh
3012cargo bench
3113```
1414+1515+5 benchmarks with different number of pages (250, 500, 1000, 2000, 4000) will be run and the time for each benchmark will be printed to the console.
32163317## Results
34183519The following results were obtained on 2025-08-27 using a MacBook Pro (13-inch, M1, 2020) with 16 GB of RAM:
36203737-| Pages | Full Build Time (ms) |
3838-| ----- | -------------------- |
3939-| 250 | 37 |
4040-| 500 | 75 |
4141-| 1000 | 151 |
4242-| 2000 | 319 |
4343-| 4000 | 676 |
2121+| Pages | Median Full Build Time (ms) |
2222+| ----- | --------------------------- |
2323+| 250 | 37 |
2424+| 500 | 75 |
2525+| 1000 | 151 |
2626+| 2000 | 319 |
2727+| 4000 | 676 |
44284529These numbers are not scientific and only serve as a rough estimate of the performance of Maudit. Your mileage may vary.
4646-4747-## On compile times
4848-4949-All the numbers in this document only include the **running time** of the benchmark. [Maudit operates on the idea that your content and assets change way more often than any parts that would require re-compilation](https://maudit.org/docs/philosophy/#your-website-changes-less-often-than-its-content) (static templates, pretty much anything in a `*.rs` file) and as such expect that the vast majority of your builds won't require compilation.
5050-5151-This is not a gotcha moment or anything we're trying to hide: **With compilation times included, Maudit is slower than most static site generators.**
···11+# overhead-benchmark
22+33+This crate contains a Maudit website that generates 10000 pages with no content to benchmark the overhead of Maudit itself.
44+55+## Running the benchmark
66+77+To run the benchmark, execute the following command:
88+99+```sh
1010+cargo bench
1111+```
+30
benchmarks/overhead/benches/build.rs
···11+use std::env;
22+use std::fs;
33+use std::path::Path;
44+55+use divan::Bencher;
66+use overhead_benchmark::build_website;
77+88+fn main() {
99+ unsafe {
1010+ env::set_var("MAUDIT_QUIET", "TRUE");
1111+ }
1212+ divan::main();
1313+}
1414+1515+#[divan::bench(sample_count = 3)]
1616+fn full_build(bencher: Bencher) {
1717+ bencher
1818+ .with_inputs(|| {
1919+ // Clear dist directory before each sample, otherwise later samples will either be very quick if we don't clean
2020+ // or very slow if we do. It's better to measure only the actual work being done. It's also closer to how it'd look like
2121+ // on platforms like Netlify or Vercel where the output directory is always cleaned before each build.
2222+ let dist_dir = Path::new("dist");
2323+ if dist_dir.exists() {
2424+ let _ = fs::remove_dir_all(dist_dir);
2525+ }
2626+ })
2727+ .bench_values(|()| {
2828+ build_website();
2929+ });
3030+}
···11+# realistic-blog-benchmark
22+33+This crate contains a Maudit website that represents a realistic average blog with 36 posts, a few images, code block, a shortcode, paginated article list, etc.
44+55+## Running the benchmark
66+77+To run the benchmark, execute the following command:
88+99+```sh
1010+cargo bench
1111+```
+30
benchmarks/realistic-blog/benches/build.rs
···11+use std::env;
22+use std::fs;
33+use std::path::Path;
44+55+use divan::Bencher;
66+use realistic_blog_benchmark::build_website;
77+88+fn main() {
99+ unsafe {
1010+ env::set_var("MAUDIT_QUIET", "TRUE");
1111+ }
1212+ divan::main();
1313+}
1414+1515+#[divan::bench(sample_count = 3)]
1616+fn full_build(bencher: Bencher) {
1717+ bencher
1818+ .with_inputs(|| {
1919+ // Clear dist directory before each sample, otherwise later samples will either be very quick if we don't clean
2020+ // or very slow if we do. It's better to measure only the actual work being done. It's also closer to how it'd look like
2121+ // on platforms like Netlify or Vercel where the output directory is always cleaned before each build.
2222+ let dist_dir = Path::new("dist");
2323+ if dist_dir.exists() {
2424+ let _ = fs::remove_dir_all(dist_dir);
2525+ }
2626+ })
2727+ .bench_values(|()| {
2828+ build_website();
2929+ });
3030+}
···11+---
22+title: Eighteenth Post
33+description: This is the eighteenth post on the blog.
44+date: 2025-09-18
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Images
3333+3434+
···11+---
22+title: Eighth Post
33+description: This is the eighth post on the blog.
44+date: 2025-09-08
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Images
3333+3434+
···11+---
22+title: Eleventh Post
33+description: This is the eleventh post on the blog.
44+date: 2025-09-11
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Fifteenth Post
33+description: This is the fifteenth post on the blog.
44+date: 2025-09-15
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Fifth Post
33+description: This is the fifth post on the blog.
44+date: 2025-09-05
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: First Post
33+description: This is the first post on the blog.
44+date: 2025-09-01
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Fourteenth Post
33+description: This is the fourteenth post on the blog.
44+date: 2025-09-14
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Code
3333+3434+You can include inline code like this: `let x = 10;`.
3535+3636+You can also include code blocks:
3737+3838+```rust
3939+fn main() {
4040+ println!("Hello, world!");
4141+}
4242+```
4343+4444+These are highlighted automatically based on the language specified.
···11+---
22+title: Fourth Post
33+description: This is the fourth post on the blog.
44+date: 2025-09-04
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Nineteenth Post
33+description: This is the nineteenth post on the blog.
44+date: 2025-09-19
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Ninth Post
33+description: This is the ninth post on the blog.
44+date: 2025-09-09
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Second Post
33+description: This is the second post on the blog.
44+date: 2025-09-10
55+---
66+77+This is another post on the blog!
···11+---
22+title: Seventeenth Post
33+description: This is the seventeenth post on the blog.
44+date: 2025-09-17
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Code
3333+3434+Here’s how you can include code snippets:
3535+3636+```rust
3737+fn main() {
3838+ println!("Hello, world!");
3939+}
4040+```
4141+4242+Its syntax is automatically highlighted based on the language specified.
···11+---
22+title: Seventh Post
33+description: This is the seventh post on the blog.
44+date: 2025-09-07
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Combining All Features
2121+2222+Here’s a sentence that combines everything:
2323+2424+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Sixteenth Post
33+description: This is the sixteenth post on the blog.
44+date: 2025-09-16
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Sixth Post
33+description: This is the sixth post on the blog.
44+date: 2025-09-06
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Code
3333+3434+Here's a code block of Python:
3535+3636+```python
3737+def greet(name):
3838+ return f"Hello, {name}!"
3939+```
4040+4141+It is syntax highlighted!
···11+---
22+title: Tenth Post
33+description: This is the tenth post on the blog.
44+date: 2025-09-10
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Images
3333+3434+
···11+---
22+title: Thirteenth Post
33+description: This is the thirteenth post on the blog.
44+date: 2025-09-13
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Thirtieth Post
33+description: This is the thirtieth post on the blog.
44+date: 2025-09-30
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** and _italic_ are easy to use.
1010+- Plain text is also important.
1111+1212+## Section 2: Links
1313+1414+- [Markdown Guide](https://www.markdownguide.org/)
1515+1616+## Section 3: Table Example
1717+1818+| Feature | Use |
1919+| ------- | -------- |
2020+| Bold | Emphasis |
2121+| Italic | Subtlety |
···11+---
22+title: Thirty-Fifth Post
33+description: This is the thirty-fifth post on the blog.
44+date: 2025-10-05
55+---
66+77+## Section 1: Formatting Text
88+99+- _Italic_ and **bold** can be combined.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Combining All Features
1616+1717+- **_Try mixing styles and links for more impact!_**
···11+---
22+title: Thirty-First Post
33+description: This is the thirty-first post on the blog.
44+date: 2025-10-01
55+---
66+77+## Section 1: Formatting Text
88+99+- _Italic_ and **bold** can be combined.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Combining All Features
1616+1717+- **_Try mixing styles and links for more impact!_**
···11+---
22+title: Thirty-Fourth Post
33+description: This is the thirty-fourth post on the blog.
44+date: 2025-10-04
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** and _italic_ are easy to use.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Table Example
1616+1717+| Feature | Use |
1818+| ------- | -------- |
1919+| Bold | Emphasis |
2020+| Italic | Subtlety |
···11+---
22+title: Thirty-Second Post
33+description: This is the thirty-second post on the blog.
44+date: 2025-10-02
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** text stands out.
1010+- _Italic_ text gives emphasis.
1111+1212+## Section 2: Links
1313+1414+- [Markdown Guide](https://www.markdownguide.org/)
1515+1616+## Section 3: Table Example
1717+1818+| Syntax | Description |
1919+| --------- | ----------- |
2020+| Header | Title |
2121+| Paragraph | Text |
2222+2323+## Youtube Shortcode Example
2424+2525+Here is an example of embedding a YouTube video using a shortcode:
2626+2727+```markdown
2828+\{{ youtube id="ekr2nIex040" /}}
2929+```
3030+3131+{{ youtube id="ekr2nIex040" /}}
···11+---
22+title: Thirty-Sixth Post
33+description: This is the thirty-sixth post on the blog.
44+date: 2025-10-06
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** text stands out.
1010+- _Italic_ text gives emphasis.
1111+1212+## Section 2: Links
1313+1414+- [Markdown Guide](https://www.markdownguide.org/)
···11+---
22+title: Thirty-Third Post
33+description: This is the thirty-third post on the blog.
44+date: 2025-10-03
55+---
66+77+## Section 1: Formatting Text
88+99+- _Italic_ and **bold** are easy in Markdown.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Combining All Features
1616+1717+- **_Try mixing styles and links for more impact!_**
···11+---
22+title: Twelfth Post
33+description: This is the twelfth post on the blog.
44+date: 2025-09-12
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Twentieth Post
33+description: This is the twentieth post on the blog.
44+date: 2025-09-20
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
3131+3232+## Section 4: Code
3333+3434+Here's a code block of TypeScript:
3535+3636+```typescript
3737+function greet(name: string): string {
3838+ return `Hello, ${name}!`;
3939+}
4040+```
4141+4242+It is syntax highlighted!
···11+---
22+title: Twenty-Eighth Post
33+description: This is the twenty-eighth post on the blog.
44+date: 2025-09-28
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** text stands out.
1010+- _Italic_ text gives emphasis.
1111+1212+## Section 2: Links
1313+1414+- [Markdown Guide](https://www.markdownguide.org/)
1515+1616+## Section 3: Table Example
1717+1818+| Syntax | Description |
1919+| --------- | ----------- |
2020+| Header | Title |
2121+| Paragraph | Text |
2222+2323+## Fun Fact
2424+2525+Many static site generators use Markdown for content.
2626+2727+## Section 4: Images
2828+2929+
···11+---
22+title: Twenty-Fifth Post
33+description: This is the twenty-fifth post on the blog.
44+date: 2025-09-25
55+---
66+77+## Section 1: Formatting Text
88+99+- _Italic_ and **bold** are easy in Markdown.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Combining All Features
1616+1717+- **_Try mixing styles and links for more impact!_**
1818+1919+## Fun Fact
2020+2121+The word "Markdown" is a play on "markup language."
···11+---
22+title: Twenty-First Post
33+description: This is the twenty-first post on the blog.
44+date: 2025-09-21
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** makes things stand out.
1212+- _Italic Text_ gives emphasis to words.
1313+- **_Bold and Italic_** combined for maximum emphasis.
1414+1515+### Mixed Formatting
1616+1717+- **This is bold and _italic_** to combine styles.
1818+- _This is italic and **bold**_ as well.
1919+2020+## Section 2: Links
2121+2222+You can include links like this:
2323+2424+- [Check out the Markdown Guide](https://www.markdownguide.org/)
2525+2626+## Section 3: Combining All Features
2727+2828+Here’s a sentence that combines everything:
2929+3030+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+---
22+title: Twenty-Fourth Post
33+description: This is the twenty-fourth post on the blog.
44+date: 2025-09-24
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** and _italic_ can be mixed.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Table Example
1616+1717+| Syntax | Description |
1818+| --------- | ----------- |
1919+| Header | Title |
2020+| Paragraph | Text |
···11+---
22+title: Twenty-Ninth Post
33+description: This is the twenty-ninth post on the blog.
44+date: 2025-09-29
55+---
66+77+## Section 1: Formatting Text
88+99+- _Italic_ and **bold** are easy in Markdown.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Combining All Features
1616+1717+- **_Try mixing styles and links for more impact!_**
1818+1919+## Fun Fact
2020+2121+Markdown is supported by many editors and platforms.
···11+---
22+title: Twenty-Second Post
33+description: This is the twenty-second post on the blog.
44+date: 2025-09-22
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold Text** and _italic text_ are useful for emphasis.
1010+- Sometimes you just need plain text.
1111+1212+## Section 2: Links
1313+1414+Here’s a useful resource:
1515+1616+- [Markdown Guide](https://www.markdownguide.org/)
1717+1818+## Fun Fact
1919+2020+Did you know? Markdown was created in 2004 by John Gruber and Aaron Swartz.
···11+---
22+title: Twenty-Seventh Post
33+description: This is the twenty-seventh post on the blog.
44+date: 2025-09-27
55+---
66+77+## Section 1: Formatting Text
88+99+- _Italic_ and **bold** can be combined.
1010+1111+## Section 2: Links
1212+1313+- [Markdown Guide](https://www.markdownguide.org/)
1414+1515+## Section 3: Combining All Features
1616+1717+- **_Try mixing styles and links for more impact!_**
1818+1919+## Fun Fact
2020+2121+You can use Markdown for notes, documentation, and more.
···11+---
22+title: Twenty-Sixth Post
33+description: This is the twenty-sixth post on the blog.
44+date: 2025-09-26
55+---
66+77+## Section 1: Formatting Text
88+99+- **Bold** and _italic_ are easy to use.
1010+- Plain text is also important.
1111+1212+## Section 2: Links
1313+1414+- [Markdown Guide](https://www.markdownguide.org/)
1515+1616+## Section 3: Table Example
1717+1818+| Feature | Use |
1919+| ------- | -------- |
2020+| Bold | Emphasis |
2121+| Italic | Subtlety |
2222+2323+## Fun Fact
2424+2525+Markdown files are just plain text!
···11+---
22+title: Twenty-Third Post
33+description: This is the twenty-third post on the blog.
44+date: 2025-09-23
55+---
66+77+## Section 1: Formatting Text
88+99+### Bold and Italic
1010+1111+- **Bold Text** stands out.
1212+- _Italic Text_ is subtle.
1313+1414+## Section 2: Combining All Features
1515+1616+Try combining styles:
1717+1818+- **_Check out the [Markdown Guide](https://www.markdownguide.org/) for more tips_**.
···11+use maud::html;
22+use maudit::route::prelude::*;
33+44+use crate::{
55+ content::ArticleContent,
66+ layout::layout,
77+ routes::{
88+ article::{ArticleParams, ArticlesParams},
99+ Article, Articles,
1010+ },
1111+};
1212+1313+#[route("/")]
1414+pub struct Index;
1515+1616+impl Route for Index {
1717+ fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
1818+ let mut articles = ctx
1919+ .content
2020+ .get_source::<ArticleContent>("articles")
2121+ .entries
2222+ .iter()
2323+ .collect::<Vec<_>>(); // Collect into a Vec to allow sorting
2424+2525+ // Sort by date, newest first
2626+ articles.sort_by(|a, b| b.data(ctx).date.cmp(&a.data(ctx).date));
2727+2828+ // Take three latest
2929+ articles = articles.into_iter().take(3).collect::<Vec<_>>();
3030+3131+ let markup = html! {
3232+ h2 { "Hello!" }
3333+ p { "Welcome to my blog. I'm a super real blog that was totally not created to serve as a benchmark. In my articles, you'll find various content such as, for example, 36 guides on how to use Markdown. Suspiciously, some of them are slightly different." }
3434+3535+ h2 { "Latest Articles" }
3636+ ul.articles-list {
3737+ @for entry in &articles {
3838+ li {
3939+ a href=(&Article.url(ArticleParams { article: entry.id.clone() })) {
4040+ h2 { (entry.data(ctx).title) }
4141+ }
4242+ p { (entry.data(ctx).description) }
4343+ span { (entry.data(ctx).date) }
4444+ }
4545+ }
4646+ }
4747+ a href=(&Articles.url(ArticlesParams { page: None })) { "See all articles..." }
4848+ }
4949+ .into_string();
5050+5151+ layout(ctx, markup)
5252+ }
5353+}
···6868 while let Some(start) = rest.find("{{") {
6969 // Check for escaped shortcode syntax like `\{{` - if found, skip this occurrence
7070 if start > 0 && rest.chars().nth(start - 1) == Some('\\') {
7171- // This is an escaped shortcode, add everything up to and including the {{
7272- output.push_str(&rest[..start + 2]);
7171+ // Remove the backslash and output the literal {{
7272+ output.push_str(&rest[..start - 1]); // up to the backslash
7373+ output.push_str("{{"); // output {{
7374 rest = &rest[start + 2..];
7475 continue;
7576 }
···1111use std::any::Any;
1212use std::path::{Path, PathBuf};
13131414-/// The result of a page render, can be either text or raw bytes.
1414+/// The result of a page render, can be either text, raw bytes, or an error.
1515///
1616/// Typically used through the [`Into<RenderResult>`](std::convert::Into) and [`From<RenderResult>`](std::convert::From) implementations for common types.
1717/// End users should rarely need to interact with this enum directly.
···2525///
2626/// impl Route for Index {
2727/// fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
2828-/// "<h1>Hello, world!</h1>".into()
2828+/// "<h1>Hello, world!</h1>"
2929/// }
3030/// }
3131/// ```
···119119 pub total_pages: usize,
120120 pub has_next: bool,
121121 pub has_prev: bool,
122122- pub next_page: Option<usize>,
123123- pub prev_page: Option<usize>,
124122 pub start_index: usize,
125123 pub end_index: usize,
126124 pub items: Vec<T>,
···143141 total_pages,
144142 has_next: page < total_pages - 1,
145143 has_prev: page > 0,
146146- next_page: if page < total_pages - 1 {
147147- Some(page + 1)
148148- } else {
149149- None
150150- },
151151- prev_page: if page > 0 { Some(page - 1) } else { None },
152144 start_index,
153145 end_index,
154146 items: page_items,
···165157 .field("total_pages", &self.total_pages)
166158 .field("has_next", &self.has_next)
167159 .field("has_prev", &self.has_prev)
168168- .field("next_page", &self.next_page)
169169- .field("prev_page", &self.prev_page)
170160 .field("start_index", &self.start_index)
171161 .field("end_index", &self.end_index)
172162 // I don't really want to force users to implement Debug for T, so just show the length of items
···179169pub type PaginatedContentPage<T> = PaginationPage<Entry<T>>;
180170181171/// Helper function to create paginated routes from any iterator
172172+///
173173+/// Example:
174174+/// ```rs
175175+/// use maudit::route::prelude::*;
176176+///
177177+/// #[route("/tags/[page]")]
178178+/// pub struct Tags;
179179+///
180180+/// #[derive(Params)]
181181+/// pub struct TagsParams {
182182+/// pub page: usize,
183183+/// }
184184+///
185185+/// impl Route<TagsParams, PaginationPage<String>> for Tags {
186186+/// fn pages(&self, ctx: &mut DynamicRouteContext) -> Vec<Page<TagsParams, PaginationPage<String>>> {
187187+/// let tags = vec!["rust".to_string(), "javascript".to_string(), "python".to_string()];
188188+/// paginate(tags, 2, |page| TagsParams { page })
189189+/// }
190190+///
191191+/// fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
192192+/// let props = ctx.props::<PaginationPage<String>>();
193193+/// format!("Page {} of tags: {:?}", props.page + 1, props.items)
194194+/// }
195195+/// }
196196+/// ```
182197pub fn paginate<T, I, Params>(
183198 items: I,
184199 per_page: usize,
···564579{
565580}
566581567567-/// Used internally by Maudit and should not be implemented by the user.
568568-/// We expose it because [`maudit_macros::route`] implements it for the user behind the scenes.
582582+/// Internal trait implemented by all routes, used by Maudit to render pages.
583583+/// [`maudit_macros::route`] implements it automatically for the user.
569584pub trait FullRoute: InternalRoute + Sync + Send {
570585 #[doc(hidden)]
571586 fn render_internal(
···1515Content sources are defined in the coronate entry point through the `content_sources!` macro.
16161717```rs
1818-use maudit::content::content_sources;
1818+use maudit::content::{content_sources, markdown_entry, glob_markdown};
19192020#[markdown_entry]
2121pub struct BlogPost {
···3030 ],
3131 content_sources![
3232 "source_name" => loader(...),
3333- "another_source" => glob_markdown<BlogPost>("path/to/files/*.md", None)
3333+ "another_source" => glob_markdown::<BlogPost>("path/to/files/*.md")
3434 ],
3535 Default::default()
3636 );
3737}
3838```
39394040-Where `loader` and `glob_markdown` are functions returning a Vec of `Entry`. Typically, a loader also accepts a type argument specifying the shape of the data for each entries it returns, which will be used inside your pages to provide typed content.
4040+Where `loader` and `glob_markdown` are functions returning a Vec of `Entry`.
4141+4242+Typically, a loader also accepts a type argument specifying the shape of the data for each entries it returns, which will be used inside your pages to provide typed content.
41434244## Using a content source in pages
4345···8991 pub section: Option<DocsSection>,
9092}
91939292-"docs" => glob_markdown::<DocsContent>("content/docs/*.md", None)
9494+"docs" => glob_markdown::<DocsContent>("content/docs/*.md")
9395```
94969595-This loader take a glob pattern (compatible with [the `glob` crate](https://github.com/rust-lang/glob)) as its first argument, and an optional `MarkdownOptions` struct as its second argument to customise Markdown rendering. The frontmatter of each Markdown file will be deserialized using [Serde](https://serde.rs) into the type argument provided to `glob_markdown`, which can use the `#[markdown_entry]` macro to derive the necessary traits and add the necessary properties to the struct. Note that using this feature require the installation of Serde into your project as the macro uses Serde's derive macros.
9797+This loader take a glob pattern (compatible with [the `glob` crate](https://github.com/rust-lang/glob)) as its sole argument.
9898+9999+The frontmatter of each Markdown file will be deserialized using [Serde](https://serde.rs) into the type argument provided to `glob_markdown`, which can use the `#[markdown_entry]` macro to derive the necessary traits and add the necessary properties to the struct. Note that using this feature require the installation of Serde into your project as the macro uses Serde's derive macros.
100100+101101+##### Markdown options
102102+103103+Markdown rendering can be customized by using [`glob_markdown_with_options`](https://docs.rs/maudit/latest/maudit/content/markdown/fn.glob_markdown_with_options.html), which takes an additional [`MarkdownOptions`](https://docs.rs/maudit/latest/maudit/content/markdown/struct.MarkdownOptions.html) argument. See the [Markdown rendering](#markdown-rendering) section for more details.
9610497105### Custom loaders
98106···225233 // ...
226234 ],
227235 content_sources![
228228- "blog" => glob_markdown::<BlogPost>("content/blog/**/*.md", Some(create_markdown_options())),
236236+ "blog" => glob_markdown_with_options::<BlogPost>("content/blog/**/*.md", create_markdown_options()),
229237 ],
230238 ..Default::default()
231239 );
···279287 // ...
280288 ],
281289 content_sources![
282282- "blog" => glob_markdown::<BlogPost>("content/blog/**/*.md", Some(create_markdown_options())),
290290+ "blog" => glob_markdown_with_options::<BlogPost>("content/blog/**/*.md", create_markdown_options()),
283291 ],
284292 ..Default::default(),
285293 );
+1-1
website/content/docs/index.md
···22title: "Prologue"
33---
4455-Welcome to the Maudit documentation! Maudit (pronounced /mo.di/, meaning _cursed_ in French) is a static site generator.
55+Welcome to the Maudit documentation! Maudit (pronounced `/mo.di/`, meaning _cursed_ in French) is [a Rust library](/docs/philosophy/#maudit-is-a-library-not-a-framework) for generating static websites.
6677[Static site generators](https://en.wikipedia.org/wiki/Static_site_generator) are tools that take a collection of files and convert them into a website, once in a build step. This is in contrast to dynamic websites, which are generated on-the-fly by a server. Other similar tools to Maudit include [Jekyll](https://jekyllrb.com), [Hugo](https://gohugo.io), [Astro](https://astro.build), [Eleventy](https://www.11ty.dev), [Zola](https://www.getzola.org) and [many more](https://jamstack.org/generators/).
88
+1-1
website/content/docs/library.md
···12121313## Function signature
14141515-The built-in `coronate` function takes a list of routes (which all implements the [FullRoute](https://docs.rs/maudit/latest/maudit/page/trait.FullRoute.html) trait), content sources, and some build options. We'll do the same.
1515+The built-in `coronate` function takes a list of routes (which all implements the [FullRoute](https://docs.rs/maudit/latest/maudit/route/trait.FullRoute.html) trait), [content sources](/docs/content), and some build options. We'll do the same.
16161717```rs
1818use maudit::{