-
Notifications
You must be signed in to change notification settings - Fork 339
Disabling use_edit_page_button
for specific files
#1187
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
Comments
There are at least a couple ways to do this on the user end (i.e., without changing the theme at all). One is to change CSS properties of the elements to pydata-sphinx-theme/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html Lines 1 to 16 in e81108b
So you could copy that file, save it in the {% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix and pagename not in my_list_of_uneditable_pages %} Will that work for your use case? |
That would've worked, but I receive the following error: Reason: UndefinedError("'get_edit_provider_and_url' is undefined") This is my configuration file. |
oops, that variable name just changed yesterday in #1177. This is the version before that change which should be compatible with the released version of the theme: pydata-sphinx-theme/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html Lines 1 to 8 in 30b2c52
|
If they are very specific files and not too many, you could always manually add some CSS rules on the page content itself (as raw css and html if using markdown, or with a "raw" directive if using RST) |
Thanks a lot! I would prefer using |
Hi @drammock
|
I wonder, if it's possible to enable
Edit this page
andShow sources
buttons on some pages - and hide them on the other?Maybe using a kind of paths list (like in
exclude_patterns
) or using file metadata?The text was updated successfully, but these errors were encountered: