Allow overriding robots tag per-site & per-page

This commit is contained in:
Aminda Suomalainen 2024-05-31 06:12:36 +03:00
parent d1b946127f
commit 8ab675d87d
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,8 @@ baseurl: "" # the subpath of your site, e.g. /blog/
# At least it's just a static page. # At least it's just a static page.
#url: "https://www.aminda.eu" # the base hostname & protocol for your site #url: "https://www.aminda.eu" # the base hostname & protocol for your site
url: "https://aminda.eu" # the base hostname & protocol for your site url: "https://aminda.eu" # the base hostname & protocol for your site
# Default meta-robots tags, can be set per-page
robots: noai, nofollow, noindex
codeberg_username: Mikaela codeberg_username: Mikaela
github_username: Mikaela github_username: Mikaela

2
_includes/head.html vendored
View File

@ -2,7 +2,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow, noai"> <meta name="robots" content="{{ page.robots | default: site.robots | default: "" }}">
<link rel="icon prefetch" href="{{site.icon}}"> <link rel="icon prefetch" href="{{site.icon}}">
<title>{% if page.title %}{{ page.title }} ~~ {{ site.title | strip_html }}{% else %}{{ site.title }}{% endif %}</title> <title>{% if page.title %}{{ page.title }} ~~ {{ site.title | strip_html }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description | strip_html | strip_newlines }}{% endif %}"> <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description | strip_html | strip_newlines }}{% endif %}">