You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The "Edit in github" link produced here from gh_edit_link and other params has an extra slash in it for us, right before the collections_dir.
To Reproduce
config.yml:
collections:
group:
output: true
another_group:
output: true
just_the_docs:
collections:
group:
name: Group
nav_fold: true
another_group:
name: Another Group
nav_fold: true
gh_edit_link: true
gh_edit_link_text: "Edit this page on GitHub"
gh_edit_repository: "https://github.com/our-account/our-repo"
gh_edit_branch: "main"
gh_edit_view_mode: "tree"
gh_edit_source: "handbook"
"Group" is a collection, with markdown files stored in the root level directory _group.
The URL produced is https://github.com/our-account/our-repo/tree/main/handbook//_group/FileName.md
Expected behavior
The generated link is a valid URL; concretely, I expect the extra slash before _group to be removed.
So the URL should be:https://github.com/our-account/our-repo/tree/main/handbook/_group/FileName.md
Additional context
If I edit the footer component and remove the slash within this if:
{% if page.collection and site.collections_dir %}/{{ site.collections_dir }}{% endif %}
, it renders the URL as I expect, with a single slash preceeding the collection directory.
The text was updated successfully, but these errors were encountered:
Ooh, interestingly, it turns out Github opens these links with extra slashes just fine; it was that we had a problem elsewhere in our gh_edit_* configs. So I'd class this as weird behaviour, but no longer as important to fix!
Hi @heatherbooker, thank you for submitting an issue! I appreciate the context that you've provided in helping me better understand this issue. Could I ask: are you setting the site.collections_dir variable anywhere in your _config.yml? I wonder if this is an empty collections_dir (but non-nil) value that's being interpreted as truthy, and is accidentally tripping this if block.
Thanks for your reply! No, we don't set collections_dir anywhere in our config. But I think maybe it is being set somewhere behind the scenes, to _group (because how else is the collection name getting into the URL?).
(btw I edited my original post because I accidentally used 2 different names for group; now it is consistent.)
Describe the bug
The "Edit in github" link produced here from gh_edit_link and other params has an extra slash in it for us, right before the collections_dir.
To Reproduce
config.yml:
"Group" is a collection, with markdown files stored in the root level directory
_group
.The URL produced is
https://github.com/our-account/our-repo/tree/main/handbook//_group/FileName.md
Expected behavior
The generated link is a valid URL; concretely, I expect the extra slash before
_group
to be removed.So the URL should be:
https://github.com/our-account/our-repo/tree/main/handbook/_group/FileName.md
Additional context
If I edit the footer component and remove the slash within this if:
, it renders the URL as I expect, with a single slash preceeding the collection directory.
The text was updated successfully, but these errors were encountered: