Static Site Generators
For people not familiar, Static Site Generators (SSG) are a simple concept (as commonly implemented).
The bottom line: An SSG only executes when generating the static content; not when viewers browse your site.
- Author your site's content in an easy-to-author format, like Markdown.
- Organize your site's content in a simple pre-defined logical directory and file structure.
- Store your site's contents in a version control system, like Git.
- Execute the SSG and it will convert your site's content into static files that can be hosted by any web server, web site hosting provider, or a cloud content delivery network (CDN).
- Use Continuous Integration / Continuous Deployment (CI/CD) pipelines - which are part of most version control. platforms - to automate the process of running the SSG to convert and deploy updates to your site.
Why use an SSG?
Why use an SSG instead of hosting a dynamic web Content Management System (CMS), like Wordpress?
- Hosting static files is commonly free - e.g. using Gitlab/Github Pages
- Static files are more secure (for your server) than dynamically generating your site. There is no need to constantly patch due to most types of security vulnerabilities.
- You don't need to run and maintain a database. Again, less maintenance and less security risk.
- Use an SSG in your favorite, or multiple, languages. Extend the SSG framework or add your own custom scripts to modify the way your site is generated however you want.
Rule of thumb: Use an SSG for simple web sites like static sites and blogs. It's also good for prototyping new sites; you can always supplement your site with dynamic content later.
What about Perl?
Perl is a language that grew up with the web from the early days of web sites being static content through the modern era of complex dynamic web apps. Perl still powers many small and large, simple and complex dynamic web sites today.
Perl has a plethora of modules adept at generating static web content, which makes Perl well suited to be used for a SSG.
You could easily build your own SSG with Perl. It's really just a matter of what features you want in a SSG. If all you want to do is convert one Markdown file to a single HTML file, that's just a one-liner script using something like Text::Markdown. Congratulations, you created your own SSG!
But SSGs are more than just one-liner Perl scripts. An SSG is really a sort of framework. Frameworks are powerful and opinionated. They help you do things well and consistently, so that you don't have to solve the same problem more than once. There is generally only one way to do things in a framework, which means that you can easily do the same thing the same way over and over again, such as updating your blog.
So, are there any Perl-based SSGs? You can probably find one that meets your needs on the CPAN
Madmongers hosts proof of concept Perl-based SSGs:
Posted by zjt