Update Blog configuration
This commit is contained in:
@ -9,7 +9,7 @@ import { fetchPosts } from '~/utils/posts';
|
||||
import { getCanonical, getPermalink, BLOG_BASE } from '~/utils/permalinks';
|
||||
|
||||
export async function getStaticPaths({ paginate }) {
|
||||
if (BLOG?.disabled) return [];
|
||||
if (BLOG?.disabled || BLOG?.blog?.disabled) return [];
|
||||
|
||||
const posts = await fetchPosts();
|
||||
|
||||
@ -26,7 +26,8 @@ const meta = {
|
||||
title: `Blog ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
|
||||
description: SITE.description,
|
||||
canonical: getCanonical(getPermalink(page.url.current)),
|
||||
ogType: "blog"
|
||||
ogType: "blog",
|
||||
noindex: currentPage > 1
|
||||
};
|
||||
---
|
||||
|
||||
|
@ -4,19 +4,19 @@ import { SITE, BLOG } from '~/config.mjs';
|
||||
import Layout from '~/layouts/PageLayout.astro';
|
||||
import SinglePost from '~/components/blog/SinglePost.astro';
|
||||
|
||||
import { getCanonical, getPermalink, cleanSlug, BLOG_BASE } from '~/utils/permalinks';
|
||||
import { getCanonical, getPermalink, cleanSlug, POST_BASE } from '~/utils/permalinks';
|
||||
import { fetchPosts } from '~/utils/posts';
|
||||
import { findImage } from '~/utils/images';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
if (BLOG?.disabled) return [];
|
||||
if (BLOG?.disabled || BLOG?.post?.disabled) return [];
|
||||
|
||||
const posts = await fetchPosts();
|
||||
|
||||
return posts.map((post) => ({
|
||||
params: {
|
||||
slug: cleanSlug(post.slug),
|
||||
blog: BLOG.postsWithoutBlogSlug ? undefined : BLOG_BASE || undefined,
|
||||
blog: POST_BASE || undefined,
|
||||
},
|
||||
props: { post },
|
||||
}));
|
||||
|
Reference in New Issue
Block a user