mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
Update items link with slugify function
This commit is contained in:
@@ -2,6 +2,7 @@ import { SITE } from "src/config";
|
|||||||
import rss from "@astrojs/rss";
|
import rss from "@astrojs/rss";
|
||||||
import type { Frontmatter } from "src/types";
|
import type { Frontmatter } from "src/types";
|
||||||
import type { MarkdownInstance } from "astro";
|
import type { MarkdownInstance } from "astro";
|
||||||
|
import slugify from "@utils/slugify";
|
||||||
|
|
||||||
const postImportResult = import.meta.glob<MarkdownInstance<Frontmatter>>(
|
const postImportResult = import.meta.glob<MarkdownInstance<Frontmatter>>(
|
||||||
"../contents/*.md",
|
"../contents/*.md",
|
||||||
@@ -17,7 +18,7 @@ export const get = () =>
|
|||||||
description: SITE.desc,
|
description: SITE.desc,
|
||||||
site: SITE.website,
|
site: SITE.website,
|
||||||
items: posts.map(({ frontmatter }) => ({
|
items: posts.map(({ frontmatter }) => ({
|
||||||
link: frontmatter.slug,
|
link: slugify(frontmatter),
|
||||||
title: frontmatter.title,
|
title: frontmatter.title,
|
||||||
description: frontmatter.description,
|
description: frontmatter.description,
|
||||||
pubDate: new Date(frontmatter.datetime),
|
pubDate: new Date(frontmatter.datetime),
|
||||||
|
|||||||
Reference in New Issue
Block a user