Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the way to create a full document #423

Open
Boiethios opened this issue Feb 25, 2024 · 2 comments
Open

Document the way to create a full document #423

Boiethios opened this issue Feb 25, 2024 · 2 comments

Comments

@Boiethios
Copy link

Hello, I am using Maud more and more along with htmx, and I really like it. It just took me a bit of time to understand how to return a full document. This is what I came up with:

pub fn document(markup: maud::Markup) -> maud::Markup {
    maud::html! {
        (maud::DOCTYPE)
        html lang="en" {
            head {
                meta charset="UTF-8";
                meta name="viewport" content="width=device-width, initial-scale=1.0";
                link rel="stylesheet" href="index.css";
                script src="https://unpkg.com/htmx.org@1.9.10" {}
                title { "My Cool WebApp" }
            }

            body { (markup) }
        }
    }
}

Maybe it could be documented somewhere?

@louiseyousre
Copy link

That's exactly what I came up with too

@Anonyfox
Copy link

Anonyfox commented May 7, 2024

thats actually a very clean way I'd say. as simple and straightforward as it gets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants