all repos — website @ 8ab05aa7c96bfb59ea6e50e0dfc6848a37e47447

My website

Use relative URLs in HTML
Alan Pearce alan@alanpearce.eu
Thu, 06 Jul 2023 20:31:08 +0200
commit

8ab05aa7c96bfb59ea6e50e0dfc6848a37e47447

parent

7b9d6622a4dd97075e8334f75dff9661e87e75ff

M themes/bear/templates/base.htmlthemes/bear/templates/base.html
@@ -8,7 +8,7 @@ <title>{%- block title %}{{ config.title }}{%- endblock %}</title>   <meta name="referrer" content="no-referrer-when-downgrade">
   {%- if config.generate_feed %}
   {% block rss -%}
-  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}">
+  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="/{{ config.feed_filename }}">
   {%- endblock -%}
   {%- endif %}
   <style>
M themes/bear/templates/header.htmlthemes/bear/templates/header.html
@@ -1,7 +1,7 @@ <a class="skip" href="#content">Skip to main content</a>
 <header>
   <h2>
-    <a href="{{ config.base_url | safe }}" class="title">
+    <a href="/" class="title">
       {{- config.title -}}
     </a>
   </h2>
M themes/bear/templates/nav.htmlthemes/bear/templates/nav.html
@@ -1,10 +1,10 @@-  <a href="{{ config.base_url | safe }}">Home</a>
+  <a href="/">Home</a>
 {%- if config.extra.main_menu %}
   {%- for item in config.extra.main_menu %}
     {%- if item.url is matching("https?://") %}
       <a href="{{ item.url | safe }}">{{ item.name }}</a>
     {%- else %}
-      <a href="{{ get_url(path=item.url) }}">{{ item.name }}</a>
+      <a href="{{ item.url }}">{{ item.name }}</a>
     {%- endif %}
   {%- endfor %}
 {%- endif -%}
M themes/bear/templates/taxonomy_single.htmlthemes/bear/templates/taxonomy_single.html
@@ -1,9 +1,9 @@ {% extends "base.html" %}
 
 {% block rss -%}
-  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}">
-  {%- set rss_path = "tags/" ~ term.name ~ "/" ~ config.feed_filename %}
-  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{% if term %}{{ term.name | title }}{% else %}{{ section.title | title }}{% endif %}" href="{{ get_url(path=rss_path) | safe }}">
+  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="/{{ config.feed_filename }}">
+  {%- set rss_path = "/tags/" ~ term.name ~ "/" ~ config.feed_filename %}
+  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{% if term %}{{ term.name | title }}{% else %}{{ section.title | title }}{% endif %}" href="{{ rss_path }}">
 {%- endblock -%}
 
 {% block main -%}