Migrate to astro v5 beta: first round
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { PaginateFunction } from 'astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
import { getCollection, render } from 'astro:content';
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import type { Post } from '~/types';
|
||||
import { APP_BLOG } from 'astrowind:config';
|
||||
@@ -41,8 +41,8 @@ const generatePermalink = async ({
|
||||
};
|
||||
|
||||
const getNormalizedPost = async (post: CollectionEntry<'post'>): Promise<Post> => {
|
||||
const { id, slug: rawSlug = '', data } = post;
|
||||
const { Content, remarkPluginFrontmatter } = await post.render();
|
||||
const { id, data } = post;
|
||||
const { Content, remarkPluginFrontmatter } = await render(post);
|
||||
|
||||
const {
|
||||
publishDate: rawPublishDate = new Date(),
|
||||
@@ -57,7 +57,7 @@ const getNormalizedPost = async (post: CollectionEntry<'post'>): Promise<Post> =
|
||||
metadata = {},
|
||||
} = data;
|
||||
|
||||
const slug = cleanSlug(rawSlug); // cleanSlug(rawSlug.split('/').pop());
|
||||
const slug = cleanSlug(id); // cleanSlug(rawSlug.split('/').pop());
|
||||
const publishDate = new Date(rawPublishDate);
|
||||
const updateDate = rawUpdateDate ? new Date(rawUpdateDate) : undefined;
|
||||
|
||||
|
Reference in New Issue
Block a user