How to hide content.action.edit and content.action.view buttons on specific pages? #8387
-
Hello Material community! I'm using the following configuration to show edit and view buttons on pages: features:
- content.action.edit
- content.action.view These buttons appear in the top-right corner of every page. I'd like to hide them on specific pages, similar to how we can hide navigation, toc, and footer using front matter: ---
hide:
- navigation
- toc
- footer
--- Is there a way to extend this functionality to hide the action buttons? I couldn't find documentation about this specific case. I'd appreciate any suggestions, whether through:
Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @pyheight, Actions are included inside the content partial: And their inclusion logic is inside their own actions partial: So you have to override either of these partials, I would go with the ---
hide_actions: true
--- an example of such conditional can be found here:
|
Beta Was this translation helpful? Give feedback.
Hi @pyheight,
you'd use theme customization in form of template overrides:
Actions are included inside the content partial:
mkdocs-material/src/templates/partials/content.html
Line 27 in 08fd869
And their inclusion logic is inside their own actions partial:
So you have to override either of these partials, I would go with the
partials/actions.html
as it's more specific.Then inside the overridden file modify the conditional a…