If you made a plugin and want it included in this directory, let me know!
→ Conditional HTML insertion
This plugin inserts an HTML snippet into the page iff that page has an element matching certain selector.
The key difference from the built-in
insert_html widget is that it can check for one element,
but insert in another. The element to check for is defined by the
selector option defines the target element to insert the snippet in.
that actually need it. Of course, that JS usually has to go to the page
not inside the content element, and you don't need it in every element, so
doesn't work well for this task.
One example is self-hosted asciinema player. It's smaller than a video
would be, but it's still quite a chunk of JS and it's better to insert it only in pages that have any
There are other possible uses of course. Here's an example that adds a warning to your page if it has any
[plugins.insert_if] file = "plugins/insert-if.lua" [widgets.blink-warning] widget = "insert_if" html = "<div><strong>Warning: blink elements are obsolete!</strong></div>" selector = "body" check_selector = "blink"
→ Site URL
This plugin changes all relative links like
/about.html to absolute like
[plugins.site-url] file = "plugins/site-url.lua" [widgets.set-site-url] widget = "site-url" site_url = "https://www.example.com"
→ Active link highlight
This plugin highlights the link to the current page/section in a navigation menu. You can see that the “Plugins” link
on this page is bold, it's what this plugin does (it adds a
nav-active class to that link).
It assumes that you are using relative links and that you keep all navigation links inside one element (like
It may require some tweaking for your website. Sample configuration:
[plugins.section-link-highlight] file = "plugins/section-link-highlight.lua" [widgets.nav-menu] widget = "include" file = "templates/menu.html" selector = "div#nav-menu" [widgets.highlight-active-link] after = "nav-menu" widget = "section-link-highlight" selector = "div#nav-menu" active_link_class = "nav-active"
If you keep navigation menu in a separate file like I do, the
after = option is necessary for correct ordering,
highlight-active-link widget may run before navigation links are actually available.