mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-04 00:20:26 +03:00
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.
This commit is contained in:
@ -19,16 +19,7 @@
|
||||
<section>
|
||||
<div>
|
||||
<a href="https://github.com/valentineus" title="GitHub" target="_blank">
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path
|
||||
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"
|
||||
>
|
||||
@ -36,31 +27,13 @@
|
||||
</svg>
|
||||
</a>
|
||||
<a href="mailto:valentin@popov.link" title="E-Mail" target="_blank">
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
|
||||
<polyline points="22,6 12,13 2,6"></polyline>
|
||||
</svg>
|
||||
</a>
|
||||
<a href="/feed.xml" title="RSS" target="_blank">
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 11a9 9 0 0 1 9 9"></path>
|
||||
<path d="M4 4a16 16 0 0 1 16 16"></path>
|
||||
<circle cx="5" cy="19" r="1"></circle>
|
||||
|
@ -2,8 +2,8 @@
|
||||
<div>
|
||||
<h1>Hi, I'm Valentin Popov 👋</h1>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<p>Welcome, and feel free to explore!</p>
|
||||
</div>
|
||||
|
9
src/env.d.ts
vendored
9
src/env.d.ts
vendored
@ -1,9 +0,0 @@
|
||||
/// <reference path="../.astro/types.d.ts" />
|
||||
interface ImportMetaEnv {
|
||||
readonly DEFAULT_TITLE: string;
|
||||
readonly DEFAULT_DESCRIPTION: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
@ -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;
|
||||
---
|
||||
|
||||
<html lang="ru">
|
||||
<Head
|
||||
title={title ?? import.meta.env.DEFAULT_TITLE}
|
||||
description={description ?? import.meta.env.DEFAULT_DESCRIPTION}
|
||||
/>
|
||||
<Head title={title} description={description} />
|
||||
|
||||
<body>
|
||||
<main>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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) => (
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -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 />
|
||||
|
Reference in New Issue
Block a user