Adds optional banner hooks for docs and blog pages#1868
Conversation
|
I've added a page to the userguide about this feature, so it's ready for review. |
There was a problem hiding this comment.
Optionally, explain explicitly that layouts/partials/hooks/banner.html can serve a banner that is defined at build time, or even an element that actually gets populated client side.
Optional because the PR already says anything's possible, just some people might not realise how broad this is.
|
Hi @fekete-robert - as I mentioned elsewhere, I'm not feeling ready for Docsy to commit to a specific mechanism for controlling banners using params etc. I've gone ahead and created core support for a "render hook" placeholder template via: Let's experiment with that for a bit before settling on the use of params or not. I'm not saying that this PR won't be merged, I just want to experiment with alternatives first. Feel free to rebase this PR in the meantime. Thanks! |
Makes it possible to optionally add banners to the top of the doc and blog pages, just above the content.
NOTE: I haven't updated the userguide yet, will do it if the users who reported the related issues think this PR is good enough to solve their problem.
Related issues: #1784 and #1773
To trigger the banner, you have to:
layouts/partials/hooks/banner.htmlbanner: yesparameter in the frontmatter of the page you want the banner on.If you want to use multiple different banners in your docs, you can create multiple files like:
layouts/partials/hooks/<custom-banner-filename>, and setbanner: yesandbanner_file: <custom-banner-filename>in the frontmatter to display the specified file as banner. Note that currently only one banner can be displayed on a page