Post layout frontmatter destructuring, space joined tags

This commit is contained in:
2023-11-25 13:43:11 -06:00
parent 61af9a3ef6
commit b5587041b1

View File

@@ -5,13 +5,14 @@ interface Props {
title: string;
url: string;
description: string;
pubDate: string;
pubDate: string;
}
const { title, description, url, pubDate } = Astro.props;
const { frontmatter } = Astro.props;
const { title, url, pubDate, tags } = frontmatter;
---
<Base title="test">
<Base title={title}>
<div class="body-container">
<h1>
<a href={url}>
@@ -26,9 +27,9 @@ const { title, description, url, pubDate } = Astro.props;
{pubDate}
</time>
</a>
<!-- {%- for tag in page.tags -%} -->
<!-- {{- "" -}}{{- tag -}} -->
<!-- {%- endfor -%} -->
<span>
{ tags.join(" ")}
</span>
</i>
<article>
<slot />
@@ -48,15 +49,6 @@ const { title, description, url, pubDate } = Astro.props;
<!-- {% endif %} -->
</p>
</div>
<hr />
<!-- <p style="text-align: center;"> -->
<!-- <a href="/feed.xml">Atom</a> | -->
<!-- <span id="commit-id" class="build-revision"><a -->
<!-- href="{{ site.github.repository_url }}/commit/{{ site.github.build_revision | default: site.env.GITHUB_SHA }}"> -->
<!-- #{{ site.github.build_revision | default: site.env.GITHUB_SHA | truncate: 7, "" }} -->
<!-- </a></span> -->
<!-- </p> -->
<slot />
</Base>