tags on post header
This commit is contained in:
parent
33e9f6b95e
commit
1740bf5a70
@ -30,6 +30,7 @@ pub struct PostTemplate {
|
|||||||
pub title: String,
|
pub title: String,
|
||||||
pub body: String,
|
pub body: String,
|
||||||
pub date: DateTime<Utc>,
|
pub date: DateTime<Utc>,
|
||||||
|
pub tags: Vec<String>,
|
||||||
pub site_footer: SiteFooter,
|
pub site_footer: SiteFooter,
|
||||||
pub header_props: HeaderProps,
|
pub header_props: HeaderProps,
|
||||||
}
|
}
|
||||||
@ -45,6 +46,7 @@ pub async fn render_post(Path(post_id): Path<String>) -> Result<PostTemplate, St
|
|||||||
Ok(PostTemplate {
|
Ok(PostTemplate {
|
||||||
title: parsed.metadata.title,
|
title: parsed.metadata.title,
|
||||||
date: parsed.metadata.date,
|
date: parsed.metadata.date,
|
||||||
|
tags: parsed.metadata.tags,
|
||||||
body: parsed.body,
|
body: parsed.body,
|
||||||
site_footer,
|
site_footer,
|
||||||
header_props: HeaderProps::default(),
|
header_props: HeaderProps::default(),
|
||||||
|
@ -600,14 +600,26 @@ video {
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-row {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
.content-end {
|
.content-end {
|
||||||
align-content: flex-end;
|
align-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-around {
|
||||||
|
align-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
.justify-end {
|
.justify-end {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.justify-around {
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
.border-blue-200 {
|
.border-blue-200 {
|
||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(191 219 254 / var(--tw-border-opacity));
|
border-color: rgb(191 219 254 / var(--tw-border-opacity));
|
||||||
@ -707,6 +719,11 @@ video {
|
|||||||
color: rgb(31 41 55 / var(--tw-text-opacity));
|
color: rgb(31 41 55 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-blue-600 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(37 99 235 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
.drop-shadow-md {
|
.drop-shadow-md {
|
||||||
--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
|
--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
|
||||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||||
|
@ -6,10 +6,17 @@
|
|||||||
<article>
|
<article>
|
||||||
<header class="px-4">
|
<header class="px-4">
|
||||||
<h1 class="text-3xl text-blue-900 mb-3">{{title}}</h1>
|
<h1 class="text-3xl text-blue-900 mb-3">{{title}}</h1>
|
||||||
|
<aside class="flex justify-around flex-row">
|
||||||
|
<section class="">
|
||||||
|
{% for tag in tags %}
|
||||||
|
<a href="/blog/tags/{{tag}}" class="text-blue-700">#{{tag}}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</section>
|
||||||
<section class="created-at m-1 text-right text-sm text-gray-600">
|
<section class="created-at m-1 text-right text-sm text-gray-600">
|
||||||
<span>Published on</span>
|
<span>Published on</span>
|
||||||
<time datetime="{date}"> {{date|pretty_date}} </time>
|
<time datetime="{date}"> {{date|pretty_date}} </time>
|
||||||
</section>
|
</section>
|
||||||
|
</aside>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section class="article-body">
|
<section class="article-body">
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<li class="my-12">
|
<li class="my-12">
|
||||||
{% include "post_preview_card.html" %} {#
|
{% include "post_preview_card.html" %}
|
||||||
<ArticlePreviewCard {article} {segment} /> #} {#
|
|
||||||
<ArticleFooter {article} {segment} /> #}
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user