#{tag}
diff --git a/src/config/site.ts b/src/config/site.ts
index 452142f..7ee5047 100644
--- a/src/config/site.ts
+++ b/src/config/site.ts
@@ -2,25 +2,21 @@ import ogImage from "@/assets/og-image.png";
export const siteConfig = {
name: "Astro Starter Pro",
- description:
- "Starter template optimized for SEO and performance. A solid foundation to start your projects with best practices.",
- url: "https://astrostarterpro.com",
- lang: "en",
- locale: "en_US",
- author: "Devgelo",
- twitter: "@Devgelo",
+ description: "Just another Astro blog",
+ url: "https://thuanbui.me",
+ lang: "vi",
+ locale: "vi_VN",
+ author: "Thuan Bui",
+ twitter: "@10h30",
ogImage: ogImage,
socialLinks: {
- twitter: "https://twitter.com",
- github: "https://github.com/devgelo-labs/astro-starter-pro",
- discord: "https://discord.com",
+ instagram: "https://instagram.com/",
+ facebook: "https://facebook.com/",
},
navLinks: [
{ text: "Home", href: "/" },
{ text: "About", href: "/about" },
- { text: "Services", href: "/services" },
{ text: "Blog", href: "/blog" },
{ text: "Contact", href: "/contact" },
- { text: "Widgets", href: "/widgets" },
],
};
diff --git a/src/content.config.ts b/src/content.config.ts
index b7dfab7..364bed4 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -5,12 +5,12 @@ const blog = defineCollection({
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/blog" }),
schema: z.object({
title: z.string(),
- description: z.string(),
+ description: z.string().optional(),
pubDate: z.coerce.date(),
author: z.string(),
image: z.string().optional(),
tags: z.array(z.string()).optional(),
- category: z.string().optional(),
+ categories: z.array(z.string()).optional(),
}),
});
diff --git a/src/pages/blog/[...slug].astro b/src/pages/[...slug].astro
similarity index 87%
rename from src/pages/blog/[...slug].astro
rename to src/pages/[...slug].astro
index bf7a971..5046c10 100644
--- a/src/pages/blog/[...slug].astro
+++ b/src/pages/[...slug].astro
@@ -16,14 +16,14 @@ const { post } = Astro.props;
const { Content, remarkPluginFrontmatter } = await render(post);
const { title, description, pubDate, author, image } = post.data;
-const formattedDate = pubDate.toLocaleDateString("es-ES", {
+const formattedDate = pubDate.toLocaleDateString("vi-VN", {
year: "numeric",
month: "long",
day: "numeric",
});
const readingTime = remarkPluginFrontmatter?.minutesRead
- ? `${Math.ceil(remarkPluginFrontmatter.minutesRead)} min de lectura`
+ ? `${Math.ceil(remarkPluginFrontmatter.minutesRead)} phút đọc`
: "";
const metadata = {
@@ -62,7 +62,11 @@ const metadata = {
{
image && (
-

+
)
}
diff --git a/src/pages/blog/category/[category].astro b/src/pages/category/[category].astro
similarity index 91%
rename from src/pages/blog/category/[category].astro
rename to src/pages/category/[category].astro
index 8d3572d..4d8b8e6 100644
--- a/src/pages/blog/category/[category].astro
+++ b/src/pages/category/[category].astro
@@ -10,9 +10,7 @@ export async function getStaticPaths() {
const categories = new Set();
posts.forEach((post) => {
- if (post.data.category) {
- categories.add(post.data.category);
- }
+ post.data.categories?.forEach((tag) => categories.add(tag));
});
return Array.from(categories).map((category) => {
@@ -20,7 +18,7 @@ export async function getStaticPaths() {
params: { category: category as string },
props: {
category,
- posts: posts.filter((post) => post.data.category === category),
+ posts: posts.filter((post) => post.data.categories === category),
},
};
});
@@ -50,7 +48,7 @@ const metadata = {
/>
diff --git a/src/pages/blog/tags/[tag].astro b/src/pages/tags/[tag].astro
similarity index 98%
rename from src/pages/blog/tags/[tag].astro
rename to src/pages/tags/[tag].astro
index d7b0b15..e17968b 100644
--- a/src/pages/blog/tags/[tag].astro
+++ b/src/pages/tags/[tag].astro
@@ -48,7 +48,7 @@ const metadata = {
/>