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

Adds optional banner hooks for docs and blog pages #1868

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fekete-robert
Copy link
Collaborator

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:

  1. Create a file in your project called layouts/partials/hooks/banner.html
  2. Add the HTML code you want in the banner to appear
  3. Set the banner: yes parameter 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 set banner: yes and banner_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

@fekete-robert fekete-robert changed the title WIP: Adds optional banner hooks for docs and blog pages Adds optional banner hooks for docs and blog pages Feb 21, 2024
@fekete-robert
Copy link
Collaborator Author

I've added a page to the userguide about this feature, so it's ready for review.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants