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

GalleryPlugin.on_page_content() crashing when page.edit_url is None #32

Closed
mchaaler opened this issue Mar 6, 2022 · 3 comments · Fixed by #27
Closed

GalleryPlugin.on_page_content() crashing when page.edit_url is None #32

mchaaler opened this issue Mar 6, 2022 · 3 comments · Fixed by #27

Comments

@mchaaler
Copy link
Contributor

mchaaler commented Mar 6, 2022

This happens when the "edit_uri" parameter is set to an empty string, as advised in MkDocs documentation when one does not want any "edit URL link" displayed on the documentation pages.

@smarie
Copy link
Owner

smarie commented Mar 8, 2022

By the way, why did you want to disable the "edit uri" option ? Just being curious

@mchaaler
Copy link
Contributor Author

mchaaler commented Mar 8, 2022

By the way, why did you want to disable the "edit uri" option ? Just being curious

At work we're hosting the project's documentation on an internal Apache web server, and I was not sure that the 'edit' link would work as expected.

Seems to me that the edit capability is tightly linked to the services provided by the hosting platform. For example, on Github, clicking on 'Edit this page' opens a page mentioning that "Submitting a change will write it to a new branch in your fork ...".

But if you have any idea on how to enable such editing capabilities in a simple way, that would certainly be useful for us! I must however confess I did not spend much time looking for additional details in MkDocs or Materials documentation pages.

@smarie
Copy link
Owner

smarie commented Mar 9, 2022

Indeed

On a few known hosts (specifically GitHub, Bitbucket and GitLab), the edit_uri is derived from the 'repo_url' and does not need to be set manually. Simply defining a repo_url will automatically populate the edit_uri configs setting.

To use a different URI than the default, simply set the edit_uri to your desired string.

Please let me know if you try - I'd be interested to know if the modification of edit uri that I do on the gallery pages is compliant with this scenario

https://www.mkdocs.org/user-guide/configuration/#edit_uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants