Add a trailing backslash to tag links generated by make www#66
Conversation
While debugging Google Search console URLs, I noticed that our "tags" buttons on articles don't end with a trailing slash, so use "tags/vectorization" (say) rather than "tags/vectorization/". Though the link still works (at least in browsers I've tested), this PR puts them into more of a canonical form to reduce exceptions. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
|
@DanilaFe : Would you check my work here? |
| <p> | ||
| Tags: | ||
| {{ range .Params.tags }} | ||
| <a class="button" href="{{ urls.JoinPath ( $.Site.BaseURL | relLangURL ) "tags" ( . | urlize ) }}">{{ . }}</a> |
There was a problem hiding this comment.
I think instead of feeding the / to urls.JoinPath (which is what happens right now), you could just move the / outside the template (right after }}) to always include it. However, if this also works, then no real reason to make any more changes.
There was a problem hiding this comment.
Oh, that's a good point. Since you don't seem to have a strong preference, I think I'll keep it this way, partly out of laziness, and partly because it keeps everything that appears in the generated "href" string at the same "scope", which feels like it makes it epsilon easier to read—i.e. having the two hardcoded string elements ("tags" and "/") appear at the same "scope" in the expression.
Thanks for the quick review!
While debugging Google Search console URLs, I noticed that our "tags" buttons on articles don't end with a trailing slash, so use "tags/vectorization" (say) rather than "tags/vectorization/". Though the link still works (at least in browsers I've tested), this PR puts them into more of a canonical form to reduce exceptions.