Crates.io | rdxl_static |
lib.rs | rdxl_static |
version | 0.0.38 |
source | src |
created_at | 2020-07-18 21:13:16.379503 |
updated_at | 2020-08-01 01:45:58.750614 |
description | Static Site Generation Utilities for RDXL |
homepage | |
repository | https://github.com/andrew-johnson-4/rdxl_static |
max_upload_size | |
id | 266680 |
size | 17,102 |
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.