Add header/metadata fields
This commit is contained in:
@@ -3,11 +3,27 @@ import BaseHead from "./BaseHead.astro"
|
|||||||
import Sidebar from "@components/sidebar"
|
import Sidebar from "@components/sidebar"
|
||||||
import Navbar from "@components/index/navbar"
|
import Navbar from "@components/index/navbar"
|
||||||
import Footer from "@components/footer"
|
import Footer from "@components/footer"
|
||||||
|
|
||||||
|
const {
|
||||||
|
meta = {}
|
||||||
|
} = Astro.props;
|
||||||
|
|
||||||
|
const {
|
||||||
|
title = "",
|
||||||
|
description = "",
|
||||||
|
ogImage = "",
|
||||||
|
articleDate = ""
|
||||||
|
} = meta;
|
||||||
---
|
---
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<BaseHead/>
|
<BaseHead
|
||||||
|
title={title}
|
||||||
|
description={description}
|
||||||
|
ogImage={ogImage}
|
||||||
|
articleDate={articleDate}
|
||||||
|
/>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Base from "src/layout/Base.astro"
|
|||||||
import Sidebar from "src/components/sidebar.astro"
|
import Sidebar from "src/components/sidebar.astro"
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base>
|
<Base meta={{title: "copyright"}}>
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<p class="text-xl">Copyright & License</p>
|
<p class="text-xl">Copyright & License</p>
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const records = await pb.collection('now').getFullList({
|
|||||||
const lastUpdated = getFormattedDate(records[0].updated)
|
const lastUpdated = getFormattedDate(records[0].updated)
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base>
|
<Base meta={{title: "now"}}>
|
||||||
|
|
||||||
<div slot="sidebar" class="text-left">
|
<div slot="sidebar" class="text-left">
|
||||||
<h2>The Now!</h2>
|
<h2>The Now!</h2>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const photos = await pb.collection('photos').getFullList({
|
|||||||
})
|
})
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base>
|
<Base meta={{title: "photos"}}>
|
||||||
<div slot="sidebar">
|
<div slot="sidebar">
|
||||||
<p id="photo-title" class="bold text-2xl">{photos[0].title === "" ? "Untitled" : photos[0].title}</p>
|
<p id="photo-title" class="bold text-2xl">{photos[0].title === "" ? "Untitled" : photos[0].title}</p>
|
||||||
<p id="photo-camera" class="text-sm">📸 {photos[0].camera}</p>
|
<p id="photo-camera" class="text-sm">📸 {photos[0].camera}</p>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const readTime = calcReadTime(wordCount);
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base>
|
<Base meta={{title: "post", description: title, ogImage: headerImage, articleDate: publishDate}}>
|
||||||
<div slot="sidebar" class="text-left">
|
<div slot="sidebar" class="text-left">
|
||||||
<img src={headerImage}/>
|
<img src={headerImage}/>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const tags = posts.flatMap(p => p.tags)
|
|||||||
const uniqueTags = tags.filter((v, i, a) => a.indexOf(v) === i)
|
const uniqueTags = tags.filter((v, i, a) => a.indexOf(v) === i)
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base>
|
<Base meta={{title: "posts"}}>
|
||||||
<div slot="sidebar" class="text-left">
|
<div slot="sidebar" class="text-left">
|
||||||
A few thoughts I've had, whenever I feel like it as you can see!
|
A few thoughts I've had, whenever I feel like it as you can see!
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user