37 releases

0.0.38 Aug 1, 2020
0.0.37 Jul 30, 2020

#1017 in Procedural macros

Download history 6/week @ 2023-06-02 1/week @ 2023-06-09 47/week @ 2023-06-16 5/week @ 2023-06-23 75/week @ 2023-06-30 6/week @ 2023-07-07 3/week @ 2023-07-14 8/week @ 2023-07-21 4/week @ 2023-07-28 4/week @ 2023-08-04 4/week @ 2023-08-11 41/week @ 2023-08-18 39/week @ 2023-08-25 4/week @ 2023-09-01 79/week @ 2023-09-08 4/week @ 2023-09-15

127 downloads per month
Used in rdxl_static_template

MIT/Apache

7KB

rdxl_static

Crates.IO Documentation Build Nightly Build

Utility Crate to Compile Static Sites based on RDXL macros

#[dot_template]
pub fn custom_template(title: String, description: String, xhtml: String) -> String {
   xhtml!(
     <html>
       <head>
         <title>{{ title }}</title>
         <meta name="description" content={{description}}/>
       </head>
       <body>{{ xhtml }}</body>
     </html>
   )
}

#[dot]
fn this_function_is_a_webpage() -> String {
   dot_html!(
      <p>This webpage uses the default HTML Template.</p>
   )
}

#[dot]
fn this_function_is_also_a_webpage() -> String {
   dot_html!(
      template=custom_template,
      title="Hello World",
      description="Classic Cinematic Drama Movie Reviews",
      <p>This year was not a good year for Cinema.</p>
   )
}

There is a template for starting new sites with rdxl_static.

Dependencies

~1.1–1.5MB
~35K SLoC