mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Replace env variable with SITE config object
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
---
|
||||
import { SITE } from "src/config";
|
||||
import Posts from "@layouts/Posts.astro";
|
||||
import PostDetails from "@layouts/PostDetails.astro";
|
||||
import getSortedPosts from "@utils/getSortedPosts";
|
||||
@@ -59,8 +60,8 @@ const currentPage =
|
||||
slug && !isNaN(Number(slug)) && totalPages.includes(Number(slug))
|
||||
? Number(slug)
|
||||
: 0;
|
||||
const lastPost = currentPage * import.meta.env.PUBLIC_POST_PER_PAGE;
|
||||
const startPost = lastPost - import.meta.env.PUBLIC_POST_PER_PAGE;
|
||||
const lastPost = currentPage * SITE.postPerPage;
|
||||
const startPost = lastPost - SITE.postPerPage;
|
||||
|
||||
const paginatedPosts = sortedPosts.slice(startPost, lastPost);
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user