docsy icon indicating copy to clipboard operation
docsy copied to clipboard

Adds optional banner hooks for docs and blog pages

Open fekete-robert opened this issue 1 year ago • 2 comments

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: https://github.com/google/docsy/issues/1784 and https://github.com/google/docsy/issues/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 avatar Feb 17 '24 17:02 fekete-robert

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

fekete-robert avatar Feb 21 '24 21:02 fekete-robert