···6677JavaScript and TypeScript files can be added to pages using the `ctx.assets.add_script()` method.
8899+In [supported templating languages](/docs/templating/), the return value of `ctx.assets.add_script()` can be used directly in the template.
1010+911```rs
1012use maudit::route::prelude::*;
1111-use maud::{html, Markup};
1313+use maud::{html};
12141313-#[route("/blog")]
1414-pub struct Blog;
1515+#[route("/")]
1616+pub struct Index;
15171616-impl Route<PageParams, Markup> for Blog {
1717- fn render(&self, ctx: &mut PageContext) -> Markup {
1818+impl Route for Index {
1919+ fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
1820 let script = ctx.assets.add_script("script.js");
19212022 html! {
···2729The `include_script()` method can be used to automatically include the script in the page, which can be useful when using layouts or other shared templates.
28302931```rs
3030-fn render(&self, ctx: &mut PageContext) -> Markup {
3232+fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
3133 ctx.assets.include_script("script.js");
32343333- layout(
3434- html! {
3535- div {
3636- "Look ma, no explicit script tag!"
3737- }
3838- }
3939- )
3535+ layout("Look ma, no explicit script tag!")
4036}
4137```
4238
+7-13
website/content/docs/styling.md
···1414use maudit::route::prelude::*;
1515use maud::{html, Markup};
16161717-#[route("/blog")]
1818-pub struct Blog;
1717+#[route("/")]
1818+pub struct Index;
19192020-impl Route<PageParams, Markup> for Blog {
2121- fn render(&self, ctx: &mut PageContext) -> Markup {
2020+impl Route for Blog {
2121+ fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
2222 let style = ctx.assets.add_style("style.css");
23232424 html! {
···3131Alternatively, the `include_style()` method can be used to automatically include the stylesheet in the page, without needing to manually add it to the template. Note that, at this time, pages without a `head` tag won't have the stylesheet included.
32323333```rs
3434-fn render(&self, ctx: &mut PageContext) -> Markup {
3434+fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
3535 ctx.assets.include_style("style.css");
36363737- layout(
3838- html! {
3939- div {
4040- "Look ma, no link tag!"
4141- }
4242- }
4343- )
3737+ layout("Look ma, no link tag!")
4438}
4539```
4640···4943Maudit includes built-in support for [Tailwind CSS](https://tailwindcss.com/). To use it, use `add_style_with_options()` or `include_style_with_options()` with the `StyleOptions { tailwind: true }` option.
50445145```rs
5252-fn render(&self, ctx: &mut PageContext) -> Markup {
4646+fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
5347 ctx.assets.add_style_with_options("style.css", StyleOptions { tailwind: true });
54485549 html! {
+4-4
website/content/docs/templating.md
···1919#[route("/")]
2020pub struct Index;
21212222-impl Route<PageParams, Markup> for Index {
2323- fn render(&self, _: &mut PageContext) -> Markup {
2222+impl Route for Index {
2323+ fn render(&self, _: &mut PageContext) -> impl Into<RenderResult> {
2424 html! {
2525 h1 { "Hello, world!" }
2626 }
···3737#[route("/")]
3838pub struct Index;
39394040-impl Route<PageParams, Markup> for Index {
4141- fn render(&self, ctx: &mut PageContext) -> Markup {
4040+impl Route for Index {
4141+ fn render(&self, ctx: &mut PageContext) -> impl Into<RenderResult> {
4242 let logo = ctx.add_image("./logo.png");
43434444 html! {