From 14ad04a4d95d937f9518502a6d03a478a0c8a4d5 Mon Sep 17 00:00:00 2001 From: nhavantuonglai Date: Thu, 26 Dec 2024 11:47:36 +0700 Subject: [PATCH] Update blog.ts --- src/utils/blog.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/utils/blog.ts b/src/utils/blog.ts index b29cd4f65..f30543d18 100644 --- a/src/utils/blog.ts +++ b/src/utils/blog.ts @@ -114,19 +114,17 @@ const load = async function (): Promise>{ let _posts: Array; -export const isBlogEnabled = APP_BLOG.isEnabled; -export const isRelatedPostsEnabled = APP_BLOG.isRelatedPostsEnabled; -export const isBlogListRouteEnabled = APP_BLOG.list.isEnabled; -export const isBlogPostRouteEnabled = APP_BLOG.post.isEnabled; -export const isBlogCategoryRouteEnabled = APP_BLOG.category.isEnabled; -export const isBlogTagRouteEnabled = APP_BLOG.tag.isEnabled; - -export const blogListRobots = APP_BLOG.list.robots; -export const blogPostRobots = APP_BLOG.post.robots; -export const blogCategoryRobots = APP_BLOG.category.robots; -export const blogTagRobots = APP_BLOG.tag.robots; - -export const blogPostsPerPage = APP_BLOG?.postsPerPage; +export const isBlogEnabled = APP_BLOG?.isEnabled ?? false; +export const isRelatedPostsEnabled = APP_BLOG?.isRelatedPostsEnabled ?? false; +export const isBlogListRouteEnabled = APP_BLOG?.list?.isEnabled ?? false; +export const isBlogPostRouteEnabled = APP_BLOG?.post?.isEnabled ?? false; +export const isBlogCategoryRouteEnabled = APP_BLOG?.category?.isEnabled ?? false; +export const isBlogTagRouteEnabled = APP_BLOG?.tag?.isEnabled ?? false; +export const blogListRobots = APP_BLOG?.list?.robots ?? ''; +export const blogPostRobots = APP_BLOG?.post?.robots ?? ''; +export const blogCategoryRobots = APP_BLOG?.category?.robots ?? ''; +export const blogTagRobots = APP_BLOG?.tag?.robots ?? ''; +export const blogPostsPerPage = APP_BLOG?.postsPerPage ?? 10; export const fetchPosts = async (): Promise>=>{ if (!_posts) {