From 423344fca500ab017c3cb7cb4b53f763400f5186 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 11 Jun 2025 17:20:43 +0000 Subject: 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. --- .env | 2 -- .prettierrc.mjs | 2 +- src/components/Sections/SocialLinks.astro | 33 +++---------------------------- src/components/Sections/Welcome.astro | 4 ++-- src/env.d.ts | 9 --------- src/layouts/BaseLayout.astro | 11 ++++------- src/pages/404.astro | 9 +++++---- src/pages/blog/[...slug].astro | 10 +++++++--- src/pages/blog/index.astro | 5 ++++- src/pages/feed.xml.js | 7 +++++-- src/pages/index.astro | 5 ++++- 11 files changed, 35 insertions(+), 62 deletions(-) delete mode 100644 .env delete mode 100644 src/env.d.ts diff --git a/.env b/.env deleted file mode 100644 index 270e1d8..0000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -DEFAULT_TITLE=Valentin Popov’s Blog -DEFAULT_DESCRIPTION=Tech insights and coding best practices from an OpenSource enthusiast and ethical hacker. \ No newline at end of file diff --git a/.prettierrc.mjs b/.prettierrc.mjs index 4933b7a..990614f 100644 --- a/.prettierrc.mjs +++ b/.prettierrc.mjs @@ -30,7 +30,7 @@ export default { }, ], plugins: ["prettier-plugin-astro"], - printWidth: 120, + printWidth: 180, proseWrap: "never", quoteProps: "consistent", requirePragma: false, diff --git a/src/components/Sections/SocialLinks.astro b/src/components/Sections/SocialLinks.astro index dbad5ef..ff04834 100644 --- a/src/components/Sections/SocialLinks.astro +++ b/src/components/Sections/SocialLinks.astro @@ -19,16 +19,7 @@
- + @@ -36,31 +27,13 @@ - + - + diff --git a/src/components/Sections/Welcome.astro b/src/components/Sections/Welcome.astro index 15ae0a3..acbeeac 100644 --- a/src/components/Sections/Welcome.astro +++ b/src/components/Sections/Welcome.astro @@ -2,8 +2,8 @@

Hi, I'm Valentin Popov 👋

- I'm a professional software developer currently working as a project manager and team lead. On my personal - website, I share thoughts on tech, leadership, and digital life. + I'm a professional software developer currently working as a project manager and team lead. On my personal website, I share thoughts on tech, leadership, and digital + life.

Welcome, and feel free to explore!

diff --git a/src/env.d.ts b/src/env.d.ts deleted file mode 100644 index d714331..0000000 --- a/src/env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -interface ImportMetaEnv { - readonly DEFAULT_TITLE: string; - readonly DEFAULT_DESCRIPTION: string; -} - -interface ImportMeta { - readonly env: ImportMetaEnv; -} diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 8ed13fd..908078e 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -5,18 +5,15 @@ import Header from "../components/Header.astro"; import "../scss/global.scss"; type Props = { - readonly description?: string; - readonly title?: string; + readonly description: string; + readonly title: string; }; -const { description, title } = Astro.props; +const { title, description } = Astro.props; --- - +
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!"; --- - +

404

Page not found

If you see this message, please - - let me know - + let me know

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; --- - +

{post.data.title}

@@ -40,7 +44,7 @@ const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"

Posted - + by {post.data.author}  •  {remarkPluginFrontmatter.minutesRead} 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[]>>((acc const years = Object.keys(postsByYear).sort((a, b) => Number(b) - Number(a)); --- - +

{ 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: `ru-ru`, - 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."; --- - + -- cgit v1.2.3