Skip to content

Instantly share code, notes, and snippets.

@stoppableforce
stoppableforce / staticsite.js
Last active March 14, 2022 12:41
A 1999.io publishing callback that simply copies the published files into another place in the filesystem and corrects the URLs to remove my username and 1999's subdomain from the path. Sort of like blogging in "single user" mode in 1999.
var store = require ("/FULL/PATH/TO/1999/INSTALL/lib/store.js");
if (screenName == "stoppableforce") {
var newpath = "/BASE/FOLDER/TO/COPY/FILES/TO/" + relpath;
var pathCorrectedBody = body.split("configured.url.with/user/yourusername").join("shorter.snappier.url");
store.newObject(newpath, pathCorrectedBody, type);
}
/*
What needs to be personalized for this on your system: