···12121313### In pages
14141515-To use an image in a page, add it anywhere in your project's directory, and use the `ctx.assets.add_image()` method to add it to a page's assets.
1515+To use an image in a page, add it anywhere in your project's directory, and use the [`ctx.assets.add_image()`](https://docs.rs/maudit/latest/maudit/assets/struct.RouteAssets.html#method.add_image) method to add it to a page's assets.
16161717```rs
1818use maudit::route::prelude::*;
···48484949## Processing images
50505151-Images added to pages can be transformed by using `ctx.assets.add_image_with_options()`.
5151+Images added to pages can be transformed by using [`ctx.assets.add_image_with_options()`](https://docs.rs/maudit/latest/maudit/assets/struct.RouteAssets.html#method.add_image_with_options), which takes an additional [`ImageOptions`](https://docs.rs/maudit/latest/maudit/assets/struct.ImageOptions.html) struct to specify how the image should be processed.
52525353```rs
5454use maudit::route::prelude::*;
···78787979Maudit supports generating low-quality image placeholders (LQIP) for images. This can be useful to improve the perceived performance of your site by showing a blurred preview of an image while the full image is loading.
80808181-To generate a placeholder, use the `placeholder()` method on an [Image](https://docs.rs/maudit/latest/maudit/assets/struct.Image.html) instance, for example returned by `ctx.assets.add_image()` or `ctx.assets.add_image_with_options()`.
8181+To generate a placeholder, use the [`placeholder()`](https://docs.rs/maudit/latest/maudit/assets/struct.Image.html#method.placeholder) method on an [Image](https://docs.rs/maudit/latest/maudit/assets/struct.Image.html) instance, for example returned by `ctx.assets.add_image()` or `ctx.assets.add_image_with_options()`.
8282+8383+It can then be included into the page by using the [`data_uri()`](https://docs.rs/maudit/latest/maudit/assets/struct.ImagePlaceholder.html#method.data_uri) method on the returned [`ImagePlaceholder`](https://docs.rs/maudit/latest/maudit/assets/struct.ImagePlaceholder.html) instance.
82848385```rs
8486use maudit::route::prelude::*;
···9698}
9799```
981009999-Alternatively, it is possible to get the dominant colors of an image using the `average_rgba()` method. This method will return a tuple of four `u8` values representing the red, green, blue, and alpha channels of the average color of the image.
101101+Alternatively, it is possible to get the dominant colors of an image using the [`average_rgba()`](https://docs.rs/maudit/latest/maudit/assets/struct.ImagePlaceholder.html#method.average_rgba) method on the placeholder. This method will return a tuple of four `u8` values representing the red, green, blue, and alpha channels of the average color of the image.
100102101103The generation of placeholders is powered by the [ThumbHash](https://evanw.github.io/thumbhash/) library.
+2-2
website/content/docs/javascript.md
···6677Maudit supports adding JavaScript and TypeScript files to your site.
8899-To import a script, add it anywhere in your project's directory, and use the `ctx.assets.add_script()` method to add it to a page's assets. Paths are relative to the project's current working directory, not the file where the method is called.
99+To import a script, add it anywhere in your project's directory, and use the [`ctx.assets.add_script()`](https://docs.rs/maudit/latest/maudit/assets/struct.RouteAssets.html#method.add_script) method to add it to a page's assets. Paths are relative to the project's current working directory, not the file where the method is called.
10101111```rs
1212use maudit::route::prelude::*;
···3434}
3535```
36363737-Alternatively, the `include_script()` method can be used to automatically include the script in the page, without needing to manually add it to the template. This can be useful when a layout or component need to include their own scripts.
3737+Alternatively, the [`include_script()`](https://docs.rs/maudit/latest/maudit/assets/struct.RouteAssets.html#method.include_script) method can be used to automatically include the script in the page, without needing to manually add it to the template. This can be useful when a layout or component need to include their own scripts.
38383939```rs
4040fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
+2-2
website/content/docs/library.md
···103103104104## Handling content
105105106106-In the current implementation, trying to use content will result in an empty list of entries. Despite what the syntax might suggest, content sources are not automatically initialized when creating a `ContentSources` instance through the `content_sources![]` macro.
106106+In the current implementation, trying to use content will result in an empty list of entries. Despite what the syntax might suggest, content sources are not automatically initialized when creating a [`ContentSources`](https://docs.rs/maudit/latest/maudit/content/struct.ContentSources.html) instance through the [`content_sources![]`](https://docs.rs/maudit/latest/maudit/macro.content_sources.html) macro.
107107108108If you've copied the previous snippets, you might have noticed that Rust has been complaining about `content_sources` being mutable but never mutated.
109109···162162163163## Conclusion
164164165165-And with that, you've succesfully rebuilt Maudit at home! There's a few more things that can be done to improve this implementation, like adding logging, copying static assets (from `options.static_dir`), asset processing, better error handling, parallelization, caching, etc, etc.
165165+And with that, you've succesfully rebuilt Maudit at home! There's a few more things that can be done to improve this implementation, like adding logging, copying static assets (from [`options.static_dir`](https://docs.rs/maudit/latest/maudit/struct.BuildOptions.html#structfield.static_dir)), asset processing, better error handling, parallelization, caching, etc, etc.
166166167167But, this is a fully functional implementation that can be used as a starting point for more advanced use cases... or just as a learning exercise to understand how Maudit works under the hood.
+1-1
website/content/docs/performance.md
···23232424### Disabling heavy features during development
25252626-When running through `maudit dev`, the `is_dev()` function will return `true`, allowing you to conditionally disable features that are slow to build or run during development.
2626+When running through `maudit dev` or by using the `MAUDIT_DEV=true` env variable, the [`is_dev()`](https://docs.rs/maudit/latest/maudit/fn.is_dev.html) function will return `true`, allowing you to conditionally disable features that are slow to build or run during development.
27272828```rs
2929use maudit::is_dev;
+6-6
website/content/docs/routing.md
···25252626## Static Routes
27272828-To create a new page in your Maudit project, create a struct and implement the `Route` trait for it, adding the `#[route]` attribute to the struct definition with the path of the route as an argument. The path can be any Rust expression, as long as its value can be converted to String. (i.e. `.to_string()` will be called on it)
2828+To create a new page in your Maudit project, create a struct and implement [the `Route` trait](https://docs.rs/maudit/latest/maudit/route/trait.Route.html) for it, adding the `#[route]` attribute to the struct definition with the path of the route as an argument. The path can be any Rust expression, as long as its value can be converted to String. (i.e. `.to_string()` will be called on it)
29293030```rs
3131use maudit::route::prelude::*;
···4040}
4141```
42424343-The `Route` trait requires the implementation of a `render` method that returns any types that can be converted into `RenderResult`. This method is called when the page is built and should return the content that will be displayed. In most cases, you'll be [using a templating library](/docs/templating/) to create HTML content.
4343+The `Route` trait requires the implementation of a [`render` method](https://docs.rs/maudit/latest/maudit/route/trait.Route.html#tymethod.render) that returns any types that can be converted into [`RenderResult`](https://docs.rs/maudit/latest/maudit/route/enum.RenderResult.html). This method is called when the page is built and should return the content that will be displayed. In most cases, you'll be [using a templating library](/docs/templating/) to create HTML content.
44444545-Maudit implements `Into<RenderResult>` for the following types:
4545+Maudit implements [`Into<RenderResult>`](https://docs.rs/maudit/latest/maudit/route/enum.RenderResult.html#trait-implementations) for the following types:
46464747- `String`, `Vec<u8>`, `&str`, `&[u8]`
4848- `Result<T, E> where T: Into<RenderResult> and E: std::error::Error` (see [Handling Errors](#handling-errors) for more information)
···56565757To create a dynamic route, export a struct using the `route` attribute and add parameters by enclosing them in square brackets (ex: `/posts/[slug]`) in the route's path.
58585959-In addition to the `render` method, dynamic routes must implement a `pages` method for Route. The `pages` method returns a list of all the possible values for each parameter in the route's path, so that Maudit can generate all the necessary pages.
5959+In addition to the `render` method, dynamic routes must implement a [`pages` method](https://docs.rs/maudit/latest/maudit/route/trait.Route.html#method.pages) for Route. The `pages` method returns a list of all the possible values for each parameter in the route's path, so that Maudit can generate all the necessary pages.
60606161```rs
6262use maudit::route::prelude::*;
···8484}
8585```
86868787-The route parameters are automatically extracted from the URL and made available through the `ctx.params::<T>()` method in the `PageContext` struct, providing type-safe access to the values.
8787+The route parameters are automatically extracted from the URL and made available through the [`ctx.params::<T>()`](https://docs.rs/maudit/latest/maudit/route/struct.PageContext.html#method.params) method in the [`PageContext`](https://docs.rs/maudit/latest/maudit/route/struct.PageContext.html) struct passed to the render method, providing type-safe access to the values.
88888989```rs
9090use maudit::route::prelude::*;
···111111}
112112```
113113114114-The struct used for the parameters must implement `Into<PageParams>`, which can be done automatically by deriving the `Params` trait. The fields of the struct must implement the `Display` trait, as they will be converted to strings to be used in the final URLs and file paths.
114114+The struct used for the parameters must implement `Into<PageParams>`, which can be done automatically by deriving the `Params` trait. The fields of the struct must implement the `Display` trait, as they will be converted to strings to be used in the final URLs and file paths. For ergonomy, it is recommended to derive the `Clone` trait as well, or the params will only be accessible by reference through [`ctx.params_ref()`](https://docs.rs/maudit/latest/maudit/route/struct.PageContext.html#method.params_ref).
115115116116Like static routes, dynamic routes must be [registered](#registering-routes) in the `coronate` function in order for them to be built.
117117
···11-use maud::html;
21use maud::PreEscaped;
33-use maudit::content::highlight_code;
22+use maud::html;
43use maudit::content::HighlightOptions;
44+use maudit::content::highlight_code;
55use maudit::route::prelude::*;
6677+use crate::layout::SeoMeta;
78use crate::layout::layout;
88-use crate::layout::SeoMeta;
991010const CODE_EXAMPLE: &str = r#"use maudit::prelude::*;
1111···9999 a.underline href="/docs/philosophy/#maudit-is-a-library-not-a-framework" { "Maudit is a library, not a framework." } " A Maudit site is a normal Rust program that you have full control over. Hook into the build process, customize the output, and use any libraries you want."
100100 }
101101 }
102102- div {
103103- pre.bg-gray-900.p-4.rounded-lg.overflow-x-auto.sm:text-base.text-sm {
102102+ div.intro-code {
103103+ pre {
104104 code {
105105 (PreEscaped(code_example))
106106 }