From e0de48c1114cc226d134f99212c429ecaef9b888 Mon Sep 17 00:00:00 2001 From: Alliot <24980252+AlliotTech@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:10:25 +0800 Subject: [PATCH 1/3] feat: allow specifying noindex for robots --- layout/_partials/head/head-unique.njk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/_partials/head/head-unique.njk b/layout/_partials/head/head-unique.njk index 899494416..00b2e668b 100644 --- a/layout/_partials/head/head-unique.njk +++ b/layout/_partials/head/head-unique.njk @@ -12,7 +12,9 @@ {%- set canonical = canonical | replace(r/\.html$/, '') %} {%- endif %} - +{% if page.noindex %} + +{% endif %} {# Exports some front-matter variables to Front-End #} {# https://hexo.io/docs/variables.html #} {{ next_data('page', next_config_unique()) }} From 26c1ddd52cc44d698813969a3853a5f9e72fb711 Mon Sep 17 00:00:00 2001 From: Alliot <24980252+AlliotTech@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:24:09 +0800 Subject: [PATCH 2/3] fix: whitespace control --- layout/_partials/head/head-unique.njk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/_partials/head/head-unique.njk b/layout/_partials/head/head-unique.njk index 00b2e668b..ee2724155 100644 --- a/layout/_partials/head/head-unique.njk +++ b/layout/_partials/head/head-unique.njk @@ -12,9 +12,9 @@ {%- set canonical = canonical | replace(r/\.html$/, '') %} {%- endif %} -{% if page.noindex %} +{%- if page.noindex %} -{% endif %} +{%- endif %} {# Exports some front-matter variables to Front-End #} {# https://hexo.io/docs/variables.html #} {{ next_data('page', next_config_unique()) }} From 944e5076a7b95fd4a2159baaabae4f724da9eec3 Mon Sep 17 00:00:00 2001 From: Mimi Date: Sun, 3 Nov 2024 14:01:18 +0800 Subject: [PATCH 3/3] Update head-unique.njk --- layout/_partials/head/head-unique.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_partials/head/head-unique.njk b/layout/_partials/head/head-unique.njk index ee2724155..517ff4834 100644 --- a/layout/_partials/head/head-unique.njk +++ b/layout/_partials/head/head-unique.njk @@ -13,7 +13,7 @@ {%- endif %} {%- if page.noindex %} - + {%- endif %} {# Exports some front-matter variables to Front-End #} {# https://hexo.io/docs/variables.html #}