diff --git a/src/config.mjs b/src/config.mjs index 16ab126..2a4aee0 100644 --- a/src/config.mjs +++ b/src/config.mjs @@ -24,20 +24,24 @@ export const BLOG = { blog: { disabled: false, pathname: 'blog', // blog main path, you can change this to "articles" (/articles) + noindex: false, }, post: { disabled: false, pathname: '', // empty for /some-post, value for /pathname/some-post + noindex: false, }, category: { disabled: false, pathname: 'category', // set empty to change from /category/some-category to /some-category + noindex: true, }, tag: { disabled: false, pathname: 'tag', // set empty to change from /tag/some-tag to /some-tag + noindex: true, }, }; diff --git a/src/pages/[...blog]/[...page].astro b/src/pages/[...blog]/[...page].astro index 92a4b66..57043a2 100644 --- a/src/pages/[...blog]/[...page].astro +++ b/src/pages/[...blog]/[...page].astro @@ -23,8 +23,8 @@ const currentPage = page.currentPage ?? 1; const meta = { title: `Blog${currentPage > 1 ? ` — Page ${currentPage}` : ''}`, description: SITE.description, + noindex: BLOG?.blog?.noindex || currentPage > 1, ogType: 'blog', - noindex: currentPage > 1, }; --- diff --git a/src/pages/[...blog]/[category]/[...page].astro b/src/pages/[...blog]/[category]/[...page].astro index ea7e93e..421f4ba 100644 --- a/src/pages/[...blog]/[category]/[...page].astro +++ b/src/pages/[...blog]/[category]/[...page].astro @@ -36,7 +36,7 @@ const currentPage = page.currentPage ?? 1; const meta = { title: `Category'${category}' ${currentPage > 1 ? ` — Page ${currentPage}` : ''}`, description: SITE.description, - noindex: true, + noindex: BLOG?.category?.noindex, }; --- diff --git a/src/pages/[...blog]/[slug].astro b/src/pages/[...blog]/[slug].astro index 0978505..1c6647a 100644 --- a/src/pages/[...blog]/[slug].astro +++ b/src/pages/[...blog]/[slug].astro @@ -28,7 +28,7 @@ const meta = { description: post.description, canonical: post.canonical || undefined, image: await findImage(post.image), - ogTitle: post.title, + noindex: BLOG?.post?.noindex, ogType: 'article', }; --- diff --git a/src/pages/[...blog]/[tag]/[...page].astro b/src/pages/[...blog]/[tag]/[...page].astro index d91027a..dc1eea9 100644 --- a/src/pages/[...blog]/[tag]/[...page].astro +++ b/src/pages/[...blog]/[tag]/[...page].astro @@ -36,7 +36,7 @@ const currentPage = page.currentPage ?? 1; const meta = { title: `Posts by tag '${tag}'${currentPage > 1 ? ` — Page ${currentPage} ` : ''}`, description: SITE.description, - noindex: true, + noindex: BLOG?.tag?.noindex, }; ---