New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add gh_edit_collections_dir
#1155
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for submitting this PR @hepheir!
I want to make sure I understand your use case. It seems like from the code you've submitted, you want to prepend gh_edit_collections_dir
to all pages, regardless of whether or not they're in a specific collection. Separately, you also are overriding site.collections_dir
.
In this case, could you instead accomplish the same goal by changing site.gh_edit_source
? It is unclear what the difference between that option and gh_edit_collections_dir
is (if you also set collections_dir = nil
).
Thanks for the comment @mattxwang :) In my case, I have set Therefore, I wanted the button "Edit this page on GitHub" to direct user to the submodule. This could be accomplished by customizing : The pages are located right under the root directory of the submodule. while
That's a sharp point. I thought exactly the same thing that i could fix this by changing And what i did was to set the value of it as - ...github.com/user/repository/tree/master/../docs/**/*
+ ...github.com/user/repository/tree/master/**/* But what actually happened was: - ...github.com/user/repository/tree/master/../docs/**/*
+ ...github.com/user/repository/tree/docs/**/* I have come to the conclusion that the url in the front can be modified, but the url that follows cannot be modified. |
Thank you for the clear explanation @hepheir, definitely helps me understand your use-case! I agree that this is something we should aim to support. However, I'm a bit wary of polluting the global Let me suggest an alternative solution: instead, we can read metadata from collections:
docs:
gh_edit_collections_dir: '...' # your stuff goes here! My hope is that this way, we can not add any more variables to the config space, and instead use what Jekyll has built in for us already. (implicit here is whether this should prepend or replace What do you think? |
Hello everyone! I made this PR to enhance existing feature: "Edit this page on GitHub" link text on footer.
In this pr,
gh_edit_collections_dir
key is added on the _config.yml. Users will be able to configuregh_edit_collections_dir
to customize url of the "Edit this page on GitHub".Leaving this value empty will make the gh_edit feature behaves same as before, therefore no worries for backward compatibility :)
I believe that this feature will be useful for those who use nested repository to store documents in a seperated github repository, like I do: