Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 736 Bytes

README.md

File metadata and controls

22 lines (13 loc) · 736 Bytes

Hugo collapsible code block

A Hugo shortcode for collapsible code blocks in your web pages.

The solution wraps the out of the box highlight feature of hugo in additional divs with attached javascript logic. This solution does not require jquery.

Example usage

This example creates a collapsible code block for CSS code.

{{< code css >}}

... lots of css code ...

{{< /code >}}

Usage tips

  1. This shortcode accepts the same parameters as the default highlight shortcode does.
  2. Be sure to include the CSS and Javascript files from the static folder into your site, or the shortcode will not work as expected.