Skip to content

Commit

Permalink
Update blog.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nhavantuonglai committed Dec 26, 2024
1 parent 2533edb commit 14ad04a
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/utils/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,17 @@ const load = async function (): Promise<Array<Post>>{

let _posts: Array<Post>;

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<Array<Post>>=>{
if (!_posts) {
Expand Down

0 comments on commit 14ad04a

Please sign in to comment.