Plugins and packaging
2024-05-29 11:04:00 +07:00 by Mark Smith
This post is part of the My static generator series. Follow the link to read the overview and get a complete list of posts.
One cool thing about the static site generator is that it's very easy to bundle up various primitives you are using to build your site into a plugin. This would typically be a seperate repo. That repo can then be npm installed prior to running the build. Those plugins can then be added and used by the static site generator.
Installing these plugins gives you the ability to quickly add prebuilt sets of pages and functionslity to your site. For example there are currently plugins written for blog, podcast, newsletter, linkblog and notes pages. They can be configured and customised via environment variables and component over-rides.
There's a rudimentary over-ride system, so the static site generator's main primitives, like for instance server-side components, can be overridden by your own custom components. That means you can easily customise pieces of the blog generated by the blog plugin to look the way you want.
Also some plugins are used by other plugins, so common functionality can be extracted and reused across plugins.
I call the over-ride system rudamentary because there's room to improve this feature, but for most basic websites it actually works rather well, and it's simple to understand. #