aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/404.astro9
-rw-r--r--src/pages/blog/[...slug].astro10
-rw-r--r--src/pages/blog/index.astro5
-rw-r--r--src/pages/feed.xml.js7
-rw-r--r--src/pages/index.astro5
5 files changed, 25 insertions, 11 deletions
diff --git a/src/pages/404.astro b/src/pages/404.astro
index e140464..7c2b420 100644
--- a/src/pages/404.astro
+++ b/src/pages/404.astro
@@ -1,17 +1,18 @@
---
import Layout from "../layouts/BaseLayout.astro";
+
+const title = "404 — Page Not Found | Valentin Popov";
+const description = "The page you're looking for doesn't exist!";
---
-<Layout>
+<Layout title={title} description={description}>
<div style="text-align:center;">
<h1>404</h1>
<p><strong>Page not found</strong></p>
<p>
<small>
If you see this message, please
- <a href=`mailto:valentin@popov.link?subject=${encodeURIComponent('I found a broken page')}`>
- let me know
- </a>
+ <a href=`mailto:valentin@popov.link?subject=${encodeURIComponent('I found a broken page')}`>let me know</a>
</small>
</p>
</div>
diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro
index 8330c80..6c904d0 100644
--- a/src/pages/blog/[...slug].astro
+++ b/src/pages/blog/[...slug].astro
@@ -18,8 +18,12 @@ export async function getStaticPaths() {
}
const post = Astro.props;
+
const { Content, remarkPluginFrontmatter } = await post.render();
-const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY");
+
+const date = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY");
+const title = `${post.data.title} | Valentin Popov`;
+const description = post.data.description;
---
<style lang="scss">
@@ -30,7 +34,7 @@ const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"
}
</style>
-<Layout description={post.data.description} title={post.data.title}>
+<Layout title={title} description={description}>
<article>
<section>
<h1>{post.data.title}</h1>
@@ -40,7 +44,7 @@ const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"
<p>
<small>
Posted
- <time datetime={post.data.pubDate.toISOString()}>{formattedDate}</time>
+ <time datetime={post.data.pubDate.toISOString()}>{date}</time>
by&nbsp;{post.data.author}
<span>&nbsp;•&nbsp;</span>
<span>{remarkPluginFrontmatter.minutesRead}</span>
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro
index 0c33b66..b240cfa 100644
--- a/src/pages/blog/index.astro
+++ b/src/pages/blog/index.astro
@@ -4,6 +4,9 @@ import { getCollection } from "astro:content";
import Layout from "../../layouts/BaseLayout.astro";
import PostElement from "../../components/PostElement.astro";
+const title = "Blog | Valentin Popov";
+const description = "A collection of articles on software development, tech leadership and open-source experiments.";
+
const posts = await getCollection("blog", ({ data }) => {
return data.draft !== true;
});
@@ -22,7 +25,7 @@ const postsByYear = posts.reduce<Record<string, CollectionEntry<"blog">[]>>((acc
const years = Object.keys(postsByYear).sort((a, b) => Number(b) - Number(a));
---
-<Layout>
+<Layout title={title} description={description}>
<section style={{ "margin-top": "3rem" }}>
{
years.map((year) => (
diff --git a/src/pages/feed.xml.js b/src/pages/feed.xml.js
index d71a020..05dd3ac 100644
--- a/src/pages/feed.xml.js
+++ b/src/pages/feed.xml.js
@@ -2,13 +2,16 @@ import { getCollection } from "astro:content";
import rss from "@astrojs/rss";
export async function GET(context) {
+ const title = "RSS Feed | Valentin Popov Blog";
+ const description = "Follow the latest posts from Valentin Popov via RSS.";
+
const posts = await getCollection("blog", ({ data }) => {
return data.draft !== true;
});
return rss({
customData: `<language>ru-ru</language>`,
- description: import.meta.env.DEFAULT_DESCRIPTION,
+ description: description,
items: posts.map((post) => ({
customData: post.data.customData,
description: post.data.description,
@@ -17,6 +20,6 @@ export async function GET(context) {
title: post.data.title,
})),
site: context.site,
- title: import.meta.env.DEFAULT_TITLE,
+ title: title,
});
}
diff --git a/src/pages/index.astro b/src/pages/index.astro
index e7ae23d..42db836 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -3,9 +3,12 @@ import Layout from "../layouts/BaseLayout.astro";
import LatestPostsSection from "../components/Sections/LatestPosts.astro";
import SocialLinksSection from "../components/Sections/SocialLinks.astro";
import WelcomeSection from "../components/Sections/Welcome.astro";
+
+const title = "Valentin Popov";
+const description = "A personal website of Valentin Popov, a software developer and team lead.";
---
-<Layout>
+<Layout title={title} description={description}>
<WelcomeSection />
<SocialLinksSection />
<LatestPostsSection />