Skip to content

Add a trailing backslash to tag links generated by make www#66

Merged
bradcray merged 1 commit intomainfrom
add-slash-after-tag-name
Mar 6, 2026
Merged

Add a trailing backslash to tag links generated by make www#66
bradcray merged 1 commit intomainfrom
add-slash-after-tag-name

Conversation

@bradcray
Copy link
Member

@bradcray bradcray commented Mar 6, 2026

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.

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>
@bradcray
Copy link
Member Author

bradcray commented Mar 6, 2026

@DanilaFe : Would you check my work here?

<p>
Tags:
{{ range .Params.tags }}
<a class="button" href="{{ urls.JoinPath ( $.Site.BaseURL | relLangURL ) "tags" ( . | urlize ) }}">{{ . }}</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@bradcray bradcray merged commit c7d0532 into main Mar 6, 2026
1 check passed
@bradcray bradcray deleted the add-slash-after-tag-name branch March 6, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants