Templates!
This commit is contained in:
parent
8dd1ffbdf5
commit
888359fead
14
Cargo.lock
generated
14
Cargo.lock
generated
|
@ -788,6 +788,12 @@ version = "2.7.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
|
||||
|
||||
[[package]]
|
||||
name = "memo-map"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "374c335b2df19e62d4cb323103473cbc6510980253119180de862d89184f6a83"
|
||||
|
||||
[[package]]
|
||||
name = "mime"
|
||||
version = "0.3.17"
|
||||
|
@ -810,6 +816,8 @@ version = "2.0.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7165d0e94806d52ad5295e4b54a95176d831814840bc067298ca647e1c956338"
|
||||
dependencies = [
|
||||
"memo-map",
|
||||
"self_cell",
|
||||
"serde",
|
||||
]
|
||||
|
||||
|
@ -1216,6 +1224,12 @@ version = "1.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "self_cell"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.200"
|
||||
|
|
|
@ -10,7 +10,7 @@ axum = { version = "0.7.5", features = ["macros", "tokio"] }
|
|||
color-eyre = "0.6.3"
|
||||
config = "0.14.0"
|
||||
futures = "0.3.30"
|
||||
minijinja = "2.0.1"
|
||||
minijinja = { version = "2.0.1", features = ["loader"] }
|
||||
notify = "6.1.1"
|
||||
redact = { version = "0.1.9", features = ["serde"] }
|
||||
sled = "0.34.7"
|
||||
|
|
7
pages/index.html.jinja
Normal file
7
pages/index.html.jinja
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "page.html.jinja" %}
|
||||
{% block body %}
|
||||
<h1>Index</h1>
|
||||
<p class="important">
|
||||
Welcome to my awesome homepage.
|
||||
</p>
|
||||
{% endblock %}
|
|
@ -54,11 +54,11 @@ async fn main() -> Besult<()> {
|
|||
info!("Tailwind spawned. {tw:#?}");
|
||||
});
|
||||
|
||||
let mut templates = Arc::new(Mutex::new(Environment::new()));
|
||||
let templates = Arc::new(Mutex::new(Environment::new()));
|
||||
while let Some(d) = tokio::fs::read_dir("templates").await?.next_entry().await? {
|
||||
templates.clone().lock().await.add_template(
|
||||
d.path().to_string_lossy().as_ref(),
|
||||
&std::fs::read_to_string(d.path())?,
|
||||
templates.clone().lock().await.add_template_owned(
|
||||
d.file_name().into_string().unwrap(),
|
||||
std::fs::read_to_string(d.path())?,
|
||||
)?;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
</head>
|
||||
|
||||
<body class="bg-base text-text">
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue