Add style of index
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-19 20:27:40 +02:00
parent eadf06c745
commit 8c615338e5
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 20 additions and 3 deletions

View file

@ -14,7 +14,14 @@ pub async fn index(config: web::Data<Config>) -> impl Responder {
#[derive(Content)]
struct BlogIndexTemplate {
posts: Option<Vec<File>>,
posts: Option<Vec<Post>>,
}
#[derive(Content)]
struct Post {
title: String,
url: String,
file: File,
}
#[once(time = 60)]

View file

@ -2,7 +2,17 @@
<html class="index" lang="fr">
{{>head.html}}
<body class="index">
<p style="color: aliceblue">Index</p>
{{>footer.html}}
{{#data}}
<h1 id="title">Blog</h1>
<div id="content">
{{^posts}}
<h2 class="subtitle">Aucun posts</h2>
{{/posts}} {{#posts}}
<h2 class="subtitle">
<a target="_self" href="/blog/{{url}}">{{title}}</a>
</h2>
{{/posts}}
</div>
{{/data}} {{>footer.html}}
</body>
</html>