mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
refactor!: update blog directory to src/data/blog
This commit is contained in:
@@ -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
|
||||||

|

|
||||||
|
|
||||||
<!-- OR -->
|
<!-- OR -->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<!-- 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:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 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!
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
Reference in New Issue
Block a user