Skip to content

Project

Novus-Flux.io

novus-flux.io

This is one of those goofy early ones, from back when I still thought that a lifetime wasted on backend engineering would make a simple Material front end easy. It is a small project space for an artist, with a Google Drive folder as its content source.

Drive was the pragmatic answer to two constraints at once. I was not going to pay for image hosting on a small portfolio, and I did not need a CMS in any real sense: Gatsby generates every derivative asset at build time, so the only thing the site needs out of storage is the original files.

A Novus-Flux plate: the title Cloud Gazer #010, the artwork, and a 10 of 100 pager
One plate of a hundred. The original came out of a Drive folder; the sizes, the formats and the page around it were generated at build time.

The plugin that pulls Drive into Gatsby had been abandoned by then, so I read it and wrote my own instead, based on its 0.2.1, but doing a bit more. Mine runs on onPreInit, before the data layer exists, and it unpacks archives on the way in: drop a zip into the folder and it arrives as a directory of assets.

js
// This is based on the 0.2.1 version of "@fs/gatsby-plugin-drive"
// But this one does a bit more
// maybe i could fork that and create a configurable solution later

...

if (extensionKappa === "zip") {
  var zip = new AdmZip(filePath);
  zip.extractAllTo(creatableFolderPath, true);
}

gdrive_asset_downloader.js – when a particular force is not adequate for the job, you just have to apply more of it.

GatsbyGoogle Drive CMS