Replace env variable with SITE config object

This commit is contained in:
Sat Naing
2022-09-22 21:32:02 +06:30
parent f8d3a3a960
commit 300fd568e9
11 changed files with 30 additions and 22 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import { SITE } from "src/config";
const getPageNumbers = (numberOfPosts: number) => {
const numberOfPages =
numberOfPosts / Number(import.meta.env.PUBLIC_POST_PER_PAGE);
const numberOfPages = numberOfPosts / Number(SITE.postPerPage);
let pageNumbers: number[] = [];
for (let i = 1; i <= Math.ceil(numberOfPages); i++) {