refactor!: update blog directory to src/data/blog

This commit is contained in:
satnaing
2025-02-25 19:33:31 +07:00
committed by Sat Naing
parent cc936ca5e4
commit 594addaec1
20 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import { glob } from "astro/loaders";
import { SITE } from "@config"; import { SITE } from "@config";
const blog = defineCollection({ const blog = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }), loader: glob({ pattern: "**/[^_]*.md", base: "./src/data/blog" }),
schema: ({ image }) => schema: ({ image }) =>
z.object({ z.object({
author: z.string().default(SITE.author), author: z.string().default(SITE.author),
@@ -118,19 +118,19 @@ Here are two methods for storing images and displaying them inside a markdown fi
You can store images inside `src/assets/` directory. These images will be automatically optimized by Astro through [Image Service API](https://docs.astro.build/en/reference/image-service-reference/). You can store images inside `src/assets/` directory. These images will be automatically optimized by Astro through [Image Service API](https://docs.astro.build/en/reference/image-service-reference/).
You can use relative path or alias path (`@assets/`) to serve these images. You can use relative path or alias path (`@/assets/`) to serve these images.
Example: Suppose you want to display `example.jpg` whose path is `/src/assets/images/example.jpg`. Example: Suppose you want to display `example.jpg` whose path is `/src/assets/images/example.jpg`.
```md ```md
![something](@assets/images/example.jpg) ![something](@/assets/images/example.jpg)
<!-- OR --> <!-- OR -->
![something](../../assets/images/example.jpg) ![something](../../assets/images/example.jpg)
<!-- Using img tag or Image component won't work ❌ --> <!-- Using img tag or Image component won't work ❌ -->
<img src="@assets/images/example.jpg" alt="something"> <img src="@/assets/images/example.jpg" alt="something">
<!-- ^^ This is wrong --> <!-- ^^ This is wrong -->
``` ```
@@ -12,7 +12,7 @@ description: "AstroPaper Version 3: Elevating Your Web Experience with Astro v3
We're excited to announce the release of AstroPaper v3, packed with new features, enhancements, and bug fixes to elevate your web development experience. Let's dive into the highlights of this release: We're excited to announce the release of AstroPaper v3, packed with new features, enhancements, and bug fixes to elevate your web development experience. Let's dive into the highlights of this release:
![AstroPaper v3](@assets/images/AstroPaper-v3.png) ![AstroPaper v3](@/assets/images/AstroPaper-v3.png)
## Table of contents ## Table of contents
@@ -12,7 +12,7 @@ description: "AstroPaper v4: ensuring a smoother and more feature-rich blogging
Hello everyone! Wishing you a happy New Year 🎉 and all the best for 2024! We're excited to announce the release of AstroPaper v4, a significant update that introduces a range of new features, improvements, and bug fixes to elevate your blogging experience. A big thank you to all the contributors for their valuable input and efforts in making version 4 possible! Hello everyone! Wishing you a happy New Year 🎉 and all the best for 2024! We're excited to announce the release of AstroPaper v4, a significant update that introduces a range of new features, improvements, and bug fixes to elevate your blogging experience. A big thank you to all the contributors for their valuable input and efforts in making version 4 possible!
![AstroPaper v4](@assets/images/AstroPaper-v4.png) ![AstroPaper v4](@/assets/images/AstroPaper-v4.png)
## Table of contents ## Table of contents