Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use hugo's built-in absURL function to produce correctly formatted absolute URLs instead of manually concatenating separators.
This is mostly an aesthetic change as browsers correctly understood the malformed URLs for the most part. Before, the template would produce URLs such as:
<a class="pure-button" href="http://localhost:1313//index.xml">[...]</a>
<a class="post-category post-category-open source" href="http://localhost:1313//categories/open-source">open source</a>
(note the double slash after the port number).
It seems as though hugo's
.Site.BaseURL
already contains a trailing slash, which would double up when building a path using e.g.{{ .Site.BaseURL }}/categories/{{ . | urlize }}
.This fix uses hugo's built-in
absURL
andprintf
functions to build correctly delimited absolute URLs for various links and resources, producing URLs such as:<a class="pure-button" href="http://localhost:1313/index.xml">[...]</a>
<a class="post-category post-category-open source" href="http://localhost:1313/categories/open-source">open source</a>
(note the single slash after the port number).