Skip to content

Commit

Permalink
Add trailing slash to certain (directory) links
Browse files Browse the repository at this point in the history
Google Search indexing apparently complains when you don't have a
trailing slash for directory-style links. For example:
`/blog/categories`
redirecting to
`/blog/categories/`
is not kosher. Looking at curl indicates that there is a proper 301
redirection.
  • Loading branch information
FrederickGeek8 committed Aug 21, 2024
1 parent e40f537 commit 2e2379e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>{{ page.title }}</h2>
<div>
<p>
<b>Posted:</b> {{ page.date | date: "%B %e, %Y" }} in
<a href="/blog/categories/{{ page.category }}">{{ page.category }}</a>. {%
<a href="/blog/categories/{{ page.category }}/">{{ page.category }}</a>. {%
if page.last_modified_at %}
<i
><b>Last Updated:</b> {{ page.last_modified_at | date: "%B %e, %Y" }}</i
Expand All @@ -40,7 +40,7 @@ <h2>{{ page.title }}</h2>
<div id="tags">
<b>Tags: </b>
{% for tag in page.tags %}
<a href="/blog/tags/{{ tag }}" class="taglink">{{ tag }}</a>
<a href="/blog/tags/{{ tag }}/" class="taglink">{{ tag }}</a>
{% endfor %}
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion blog/categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>Post by Category:</h2>
{% assign sortedcats = categories | split:' ' | sort %}

{% for category in sortedcats %}
<h3 id="{{ category }}"><a href="{{page.dir}}{{ category }}">{{ category }}</a></h3>
<h3 id="{{ category }}"><a href="{{page.dir}}{{ category }}/">{{ category }}</a></h3>
<ul>
{% for post in site.categories[category] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ redirect_from: /blog.html
</h3>
<p>
<b>Posted:</b> {{ post.date | date: "%B %e, %Y" }} in
<a href="/blog/categories/{{ post.category }}">{{ post.category }}</a>. {%
<a href="/blog/categories/{{ post.category }}/">{{ post.category }}</a>. {%
if post.last_modified_at %}
<i
><b>Last Updated:</b> {{ post.last_modified_at | date: "%B %e, %Y" }}</i
Expand Down
2 changes: 1 addition & 1 deletion blog/tags/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>Post by Tag:</h2>
{% assign sortedtags = tags | split:' ' | sort %}

{% for tag in sortedtags %}
<h3 id="{{ tag }}"><a href="{{page.dir}}{{ tag }}">{{ tag }}</a></h3>
<h3 id="{{ tag }}"><a href="{{page.dir}}{{ tag }}/">{{ tag }}</a></h3>
<ul>
{% for post in site.tags[tag] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
Expand Down

0 comments on commit 2e2379e

Please sign in to comment.