If you like my work, please consider supporting its development.

A lot has gone on since the last update. The theme has completely changed under the hood and has a new name. There’s a new form-handling server (currently in beta) that makes it easy to do what you want when people submit forms on your website. Plus, future plans for keeping the projects sustainable.

Midnight Theme

After deciding I was going to add other, related software under the umbrella of BluestNight, I figured I needed to rename the theme to avoid ambiguity when writing about the theme versus the collection of software. Midnight sounded like a good name, it wasn’t taken on the Hugo Themes showcase, and it fits the BluestNight theme. Midnight it was.

A lot has changed between the last release of BluestNight theme and the first release of Midnight. Some were planned. Others came about after I realized now would be the best time to do any backwards-incompatible changes.

Foundation CSS

The theme was originally written with Foundation, a CSS framework similar in ways to Bootstrap, but without that “this was definitely made in Bootstrap” feeling. Foundation was removed when I decided to make the theme a little lighter by implementing only the things I needed. It’s been added back in now that I have other projects to work on - it’s nice to let the framework do some of the heavy lifting - and to make this next item easier.

Plugins!

Possibly the biggest change under the hood - maybe second to switching in Foundation - was the gutting and reorganizing of the templates to foster a plugin system.

Midnight supports four kinds of plugins: general plugins, sidebar widgets, shortcodes, and comment providers.

General plugins are the simplest kind of plugin. They are only able to insert content into the <head> and at the end of the <body> of every page - such as for inserting CSS or JavaScript, respectively, or adding metadata to each page. You could, for instance, load custom fonts and use them instead of the theme defaults, or integrate a different analytics system on the site.

Sidebar widgets have existed as part of the theme before, but this allows site creators to make their own widgets to integrate with their needs. Widgets can also insert code into the site like general plugins: Midnight will automatically include that code when that widget is enabled.

Shortcodes are nothing new in Midnight, nor are they particular to it. Rather, the idea of shortcode plugins are to integrate your custom shortcodes into the theme, so that you can load whatever CSS and/or JavaScript is necessary for the shortcode to work correctly. That code will only be included on a page if the shortcode is used on it, preventing unnecessary requests and longer load times.

Comment providers allows site owners to integrate their preferred commenting system onto content pages, while allowing all of the theme controls for whether comments load on a page to still work. And, again, any CSS or JavaScript necessary to make the comment system work can be loaded on the page as needed and in the appropriate places.

Mobile Menu

Midnight does away with the accordion-style menu from the BluestNight theme and instead uses Foundation’s off-canvas combined with the drilldown menu for a better experience.

Assets, Not Static Files

Midnight now uses asset resources for its CSS and JavaScript files. This allows the theme to rely on Hugo to minify files instead of bundling separate minified and non-minified versions (which can lead to bugs being fixed in the latter and not the former). Hugo can also bundle multiple assets together in one file, if desired, such as for the next added feature.

Optimizing For The Modern Web

Midnight now comes with the option to optimize for HTTP/1.1 or HTTP/2. You can find a discussion about the differences in the documentation, but the big idea is that a few large, bundled files is better for HTTP/1.1 and a bunch of small, separate files is better for HTTP/2. Midnight allows you to choose which to build for. If you really wanted, you could even build one for each and let your server choose which version to serve, based on if the browser supports it or not.

Changed Shortcodes, And More

A new shortcode has been added to work with the new form-handling server. The static shortcode has been renamed to link and is now much more powerful. Plus, a bunch of other smaller things I may have forgotten. It’s really worth looking through the documentation, especially if you were previously using BluestNight.

Nebula Forms

Meet Nebula, the newest addition to the BluestNight suite of software (if it can be called that yet).

Nebula is a form-handling server configured with TOML files that lets you choose what to do when a form is submitted. It’s written in Go and takes advantage of Go’s template system (the same one behind Hugo themes) and Go’s plugin system to make a customizable and extensible piece of software. It is integrated with Midnight but can be used with any website on any platform.

Nebula currently only supports sending emails when forms are submitted, though those emails can be easily customized using templates, even to determine whether fields should have values at all. It also supports generating errors to return to the user - the most important piece of server-side validation.

The software is currently in beta, as it hasn’t been battle-tested too much and there are some security-related features I’d still like to build in - features like audit logs and rate limiting to help prevent people from abusing the server software.

If you want to help out, check out the guides for setting up Nebula on your own machine and file an issue if you run into any issues or something isn’t implemented that you think should be.

Supporting the Projects

If you like the stuff I’m doing, please consider donating. I work on these and other projects in my spare time, and paying for server space, privacy policies, and other things necessary to keep this all running is burning through my savings. I’m a full-time college student, so once school starts I’m going to have a lot less free time to work on these projects. I’d rather not have to spend it working on campus to be able to pay server bills.

For those who are curious how much that is, I’ve posted previously on my personal programming blog about what those costs are.

The two main ways you can support are through Patreon and Liberapay. Both are recurring donation platforms, so if you want to make a one-time donation, the best way to do so is to subscribe for the amount, then unsubscribe when the payment goes through.

Finally, thanks to those who are currently supporting as they are able. It’s not much, but it does help.

Future Plans

I’m going to be working on building Nebula into a good stable release, plus contributing to Commento, a self-hosting comment platform that is integrated with Midnight. It’s not enabled on this site yet as there are a couple of things I’d like to see in it first, but it will soon be the system running the comments on this and my other sites.

Past that, I intend on making a server that integrates with Stripe and platforms like Patreon and Liberapay to give subscribers a single account that can be used to access versions of Nebula and Commento hosted by me, as a thank you for supporting. It probably won’t come for some time, as I work on getting some other things polished first, but it will happen.

Until next time!