Add option to output canonical URL

Canonical links are handy to tell search engines which page is
canonical amongst various permutations of URLs (e.g. https vs. http
and www subdomain or not).  Add an option to output one via the
following pelicanconf.py setting:

REL_CANONICAL = True
This commit is contained in:
saagit 2020-08-16 08:37:49 -07:00
parent 0f0ea7e824
commit 4d2a9f81e6

View file

@ -115,6 +115,9 @@
<meta name="msapplication-TileColor" content="{{ BROWSER_COLOR }}">
{% endif %}
{% if REL_CANONICAL %}
<link rel="canonical" href="{{ SITEURL }}/{{ output_file }}">
{% endif %}
{% block meta %}
<meta name="author" content="{{ AUTHOR }}" />
<meta name="description" content="{{ SITEDESCRIPTION }}" />