https://ziggy-lang.io

https://ziggy-lang.io

Source: https://github.com/kristoff-it/ziggy-lang.io

This website features a mildly interesting approach to building the sidebar menu of the documentation section.

The layout loops the contents of a custom frontmatter key to generated a series of <details> elements. Note also how each page is tested to see if it’s the current page, in which case it is styled differently.

While the frontmatter custom data referenced in the outer loop looks like this:

I could have used nested structs to give better names to the first and second element of each docs-sidebar entry, but for something this simple I decided that array ‘tuples’ were fine.

1 Like