Practical tips

Adding a selected state to a navigation item

To add selected state, you can use the global pathname to match against the current URL.

So for example, if the current global pathname is /module/name, and you want to add an active class to an li element, you would write code like li(class=pathname.match(/module/\name/)?'active':'').

Note that you are basically directly writing Javascript in pug here. This is not a Bedrock feature, it is just a very common example that everyone will need at some point.

Adding a favicon

Simply add a favicon.ico in the content folder. Every file in the root of the content folder gets copied to the dist, the folder where your static site result ends up.