#static #generation #website

rdxl_static

Static Site Generation Utilities for RDXL

37 releases

0.0.38 Aug 1, 2020
0.0.37 Jul 30, 2020

#1944 in Procedural macros

35 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.5MB
~37K SLoC