aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-09-06 11:21:27 +0300
committerValentin Popov <valentin@popov.link>2024-09-06 11:21:27 +0300
commit2f362eaf0937360a0f2a81bac41be81111fa06a8 (patch)
treec4112b7007de8f2a6dc498b81ab02ab68f126834 /src/pages
parent17c3115a0608bb7ef42c8038b36f24b2356004ec (diff)
downloadpopov.link-2f362eaf0937360a0f2a81bac41be81111fa06a8.tar.xz
popov.link-2f362eaf0937360a0f2a81bac41be81111fa06a8.zip
Added reading time timer
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/blog/[...slug].astro21
-rw-r--r--src/pages/feed.xml.js2
-rw-r--r--src/pages/index.astro2
3 files changed, 21 insertions, 4 deletions
diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro
index c94fe52..a142db4 100644
--- a/src/pages/blog/[...slug].astro
+++ b/src/pages/blog/[...slug].astro
@@ -1,6 +1,6 @@
---
import { type CollectionEntry, getCollection } from "astro:content";
-import Layout from "../../layouts/PostLayout.astro";
+import Layout from "../../layouts/PageLayout.astro";
export async function getStaticPaths() {
const posts = await getCollection("blog");
@@ -12,9 +12,26 @@ export async function getStaticPaths() {
type Props = CollectionEntry<"blog">;
const post = Astro.props;
-const { Content } = await post.render();
+const { Content, remarkPluginFrontmatter } = await post.render();
---
+<style>
+ .header {
+ text-align: center;
+ }
+</style>
+
<Layout>
+ <div class="header">
+ <h1>Title</h1>
+ <p>
+ <small>
+ Posted
+ <time datetime="#">#</time>
+ &nbsp;by&nbsp;Valentin Popov&nbsp;‐
+ <strong>{remarkPluginFrontmatter.minutesRead}</strong>
+ </small>
+ </p>
+ </div>
<Content />
</Layout>
diff --git a/src/pages/feed.xml.js b/src/pages/feed.xml.js
index 0fcc82f..a509386 100644
--- a/src/pages/feed.xml.js
+++ b/src/pages/feed.xml.js
@@ -1,5 +1,5 @@
-import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
+import rss from "@astrojs/rss";
export async function GET(context) {
const posts = await getCollection("blog");
diff --git a/src/pages/index.astro b/src/pages/index.astro
index bc98c67..c4f5577 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,6 +1,6 @@
---
-import Layout from "../layouts/PageLayout.astro";
import { getCollection } from "astro:content";
+import Layout from "../layouts/PageLayout.astro";
const posts = await getCollection("blog");
---