diff options
author | Valentin Popov <valentin@popov.link> | 2025-06-11 20:20:43 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2025-06-11 20:20:43 +0300 |
commit | 423344fca500ab017c3cb7cb4b53f763400f5186 (patch) | |
tree | b2e1f7df9dd767ca89fd3b1e30c30dadc0a56bfa /src/pages/blog | |
parent | 78a9c2abc56d47637eaa46eb1ce99b682d7bde0d (diff) | |
download | popov.link-423344fca500ab017c3cb7cb4b53f763400f5186.tar.xz popov.link-423344fca500ab017c3cb7cb4b53f763400f5186.zip |
chore: remove unused environment variables and update layout components
- Deleted the .env and src/env.d.ts files as they are no longer needed.
- Updated BaseLayout to require title and description props directly, ensuring better clarity in component usage.
- Adjusted various pages to pass explicit title and description values, enhancing SEO and user experience.
- Increased print width in .prettierrc.mjs for improved code formatting.
Diffstat (limited to 'src/pages/blog')
-rw-r--r-- | src/pages/blog/[...slug].astro | 10 | ||||
-rw-r--r-- | src/pages/blog/index.astro | 5 |
2 files changed, 11 insertions, 4 deletions
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 {post.data.author} <span> • </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) => ( |