Change posts.js to blog.js and improve default values
This commit is contained in:
@ -5,8 +5,8 @@ import Layout from '~/layouts/PageLayout.astro';
|
||||
import BlogList from '~/components/blog/List.astro';
|
||||
import Pagination from '~/components/common/Pagination.astro';
|
||||
|
||||
import { fetchPosts } from '~/utils/posts';
|
||||
import { cleanSlug, CATEGORY_BASE } from '~/utils/permalinks';
|
||||
import { fetchPosts } from '~/utils/blog';
|
||||
import { CATEGORY_BASE } from '~/utils/permalinks';
|
||||
import Title from '~/components/blog/Title.astro';
|
||||
|
||||
export async function getStaticPaths({ paginate }) {
|
||||
@ -22,7 +22,7 @@ export async function getStaticPaths({ paginate }) {
|
||||
paginate(
|
||||
posts.filter((post) => typeof post.category === 'string' && category === post.category.toLowerCase()),
|
||||
{
|
||||
params: { category: cleanSlug(category), blog: CATEGORY_BASE || undefined },
|
||||
params: { category: category, blog: CATEGORY_BASE || undefined },
|
||||
pageSize: BLOG.postsPerPage,
|
||||
props: { category },
|
||||
}
|
||||
|
Reference in New Issue
Block a user