Skip to content
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

Add Edit on Github pages for orgs/datasets #195

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

BryanQuigley
Copy link
Collaborator

@BryanQuigley BryanQuigley merged commit 156035b into timwis:gh-pages Nov 7, 2022
@timwis
Copy link
Owner

timwis commented Nov 11, 2022

Great idea @JackGilmore! Agree it makes sense to have this upstream. Thanks for adding it in @BryanQuigley. Just wanted to flag that there's an alternative way to generate the link that (a) doesn't require users set the repo in _config.yml when installing, and (b) handles cases where gh-pages is not the primary branch.

Jekyll sites built on GitHub pages are built with a set of plugins, including github-metadata, which comes with a liquid helper to generate a github edit link. This lets you do:

<a href="{% github_edit_link %}">Open in GitHub</a>

The only thing is that helper would probably fail to run locally without that gem installed, so we'd need to add the github-pages gem to the Gemfile, which we should have done ages ago, as it provides much greater dev-prod parity.

I've just tested this out locally, and it seems to work, so I'll push it up to save you the trouble. Let me know what you think.

@JackGilmore
Copy link

Awesome! Glad this was of help and thanks for passing on that bit of knowledge about an easier way to implement the help link. Think I'll be adding in a PR on our JKAN instance to implement this downstream!

@BryanQuigley BryanQuigley deleted the add_edit_on_github branch November 14, 2022 18:25
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.

None yet

3 participants