mirror of https://github.com/luizdepra/hugo-coder.git

tobinjt
20.19.2018 d89edf3e1b31baed524e5866b6d58fdc7dcad5f6
Add trailing slash to remove redirects. (#112)

* Add trailing slash to remove redirects.

When you request /tags/foo, the web server will redirect you to
/tags/foo/ so the browser needs to make two requests. Add the trailing
slash in the link so that only one request is needed.

* Add trailing slash to remove redirects.

* Improve how trailing slash is added.

Co-Authored-By: tobinjt <johntobin@johntobin.ie>

* Improve how trailing slash is added.

Co-Authored-By: tobinjt <johntobin@johntobin.ie>

* Add John Tobin.
3 files modified
5 ■■■■■ changed files
CONTRIBUTORS.md 1 ●●●● patch | view | raw | blame | history
layouts/partials/taxonomy/categories.html 2 ●●● patch | view | raw | blame | history
layouts/partials/taxonomy/tags.html 2 ●●● patch | view | raw | blame | history
CONTRIBUTORS.md
@@ -24,3 +24,4 @@
- [Joseph Ting](https://github.com/josephting)
- [Abner Campanha](https://github.com/abnerpc)
- [Martin Kiesel](https://github.com/Kyslik)
- [John Tobin](https://www.johntobin.ie/)
layouts/partials/taxonomy/categories.html
@@ -4,6 +4,6 @@
    {{- if gt $index 0 }}
      <span class="separator">•</span>
    {{- end }}
    <a href="{{ ( print "categories/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
    <a href="{{ ( printf "categories/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
  {{- end -}}
</div>
layouts/partials/taxonomy/tags.html
@@ -4,6 +4,6 @@
    {{- if gt $index 0 }}
      <span class="separator">•</span>
    {{- end }}
    <a href="{{ ( print "tags/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
    <a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
  {{- end -}}
</div>