diff --git a/astro.config.mjs b/astro.config.mjs index 4676e10..0e6ed4f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -70,9 +70,6 @@ export default defineConfig({ ], ], }, - redirects: { - "/": "/page/1", - }, vite: { plugins: [yaml()], css: { diff --git a/src/pages/[...page].astro b/src/pages/[...page].astro new file mode 100644 index 0000000..139cffb --- /dev/null +++ b/src/pages/[...page].astro @@ -0,0 +1,22 @@ +--- +import MainGridLayout from "../layouts/MainGridLayout.astro"; +import PostCard from "../components/PostCard.astro"; +import Pagination from "../components/control/Pagination.astro"; +import {getSortedPosts} from "../utils/content-utils"; +import {getPostUrlBySlug} from "../utils/url-utils"; +import {PAGE_SIZE} from "../constants/constants"; +import PostPage from "../components/PostPage.astro"; + +export async function getStaticPaths({ paginate }) { + const allBlogPosts = await getSortedPosts(); + return paginate(allBlogPosts, { pageSize: PAGE_SIZE }); +} + +const {page} = Astro.props; + +--- + + + + + \ No newline at end of file diff --git a/src/pages/page/[page].astro b/src/pages/page/[page].astro deleted file mode 100644 index c269629..0000000 --- a/src/pages/page/[page].astro +++ /dev/null @@ -1,36 +0,0 @@ ---- -import MainGridLayout from "@layouts/MainGridLayout.astro"; -import TitleCard from "@components/TitleCardNew.astro"; -import Pagination from "@components/control/Pagination.astro"; -import {getSortedPosts} from "@utils/content-utils"; -import {getPostUrlBySlug} from "@utils/url-utils"; - -export async function getStaticPaths({ paginate }) { - const allBlogPosts = await getSortedPosts(); - return paginate(allBlogPosts, { pageSize: 8 }); -} - -const {page} = Astro.props; - ---- - - -
- {page.data.map((entry: { data: { draft: boolean; title: string; tags: string[]; category: string; published: Date; image: string; description: string; }; slug: string; }) => { - return ( - - ); - })} -
- -
\ No newline at end of file diff --git a/vercel.json b/vercel.json index 56faa9e..0967ef4 100644 --- a/vercel.json +++ b/vercel.json @@ -1,9 +1 @@ -{ - "redirects": [ - { - "source": "/", - "destination": "/page/1", - "statusCode": 307 - } - ] -} +{}