Refactor and add more configuration to src/config.mjs

This commit is contained in:
prototypa
2023-01-06 16:01:06 -05:00
parent ba2b6081ed
commit f6672ce070
8 changed files with 99 additions and 72 deletions

View File

@ -10,7 +10,7 @@ import { BLOG_BASE } from '~/utils/permalinks';
import Title from '~/components/blog/Title.astro';
export async function getStaticPaths({ paginate }) {
if (BLOG?.disabled || BLOG?.blog?.disabled) return [];
if (BLOG?.disabled || BLOG?.list?.disabled) return [];
return paginate(await fetchPosts(), {
params: { blog: BLOG_BASE || undefined },
pageSize: BLOG.postsPerPage,
@ -23,7 +23,7 @@ const currentPage = page.currentPage ?? 1;
const meta = {
title: `Blog${currentPage > 1 ? ` — Page ${currentPage}` : ''}`,
description: SITE.description,
noindex: BLOG?.blog?.noindex || currentPage > 1,
noindex: BLOG?.list?.noindex || currentPage > 1,
ogType: 'blog',
};
---