rockfish - 0.2.0
Generate static HTML files, (along with all dependencies ) from the Wordpress API!
Built in nodejs. It runs a server on
localhost:9424 (by default), which can trigger generation of static HTML files from a wordpress site. (Or any API which returns a similar JSON structure of URLs).
Files are generated to a local
outputDir (as specified in the
These files can then be served without having to hassle Wordpress's DB. Speeding up the site, and securing your server!
Rockfish requires yarn.
git clone email@example.com:sociomantic-tsunami/rockfish.git
Setup a config file.
yarn run buildcompiles via babel
cfg/config.js file in the vein of the
- outputDir is the location the generated files will be stored.
For production or local development, you can set rockfish to run on startup, to do this us pm2's upstart capabilities. (On production run as the
You can retrieve the generation command for this via
yarn run pm2 startup.
Once installed can currently trigger the api via making a request with a site configuration.
http://localhost:<port>/rockfish?env=<environment, eg www as from config >&site=<subsite (if using wordpress multisite)ß>
curl 'http://localhost:9424/rockfish?env=cms&site=de'. This will trigger site generation of the cms.de site as outlined in the config file.
Generated sites are output to the
outputDir as a root. Sites should have a named subfolder to contain the generated output in the format:
cms representing a site grouping and
de the domain as in the
Inside of this the full folder structure is built, with
releases containing the previous site versions, and
current-release a symlink pointing to the latest version.
yarn run watchruns nodemon and compiles via babel watch
Ensure you have
export NODE_ENV=developmentin your
yarn run tddrun mocha tests in continuous watch mode.
yarn run pm2 start rockfish.json --env development.
Check the logs
yarn run pm2 logs
yarn run tdd for watch or
yarn run test to run once.
How can I login to my site though?
This is not a replacement for your wordpress installation, but it does let you separate it from the WWW.
You can have
yoursite.com serving static files (regenerated as often as you like), while serve the CMS portion of Wordpress from a more secure (password protected? offline?) server.
What about my dynamic content?
Static site generation can be triggered every time you update content. So if you only want to show 'latest posts', this is not a problem.
More advanced dynamic sites, customising per user, or needing users to log in etc wont work with this. Sorry. Rockfish is a simple creature for the simple sites out there that want to negate Wordpress' basic bottlenecks of SQL/PHP and keep things more secure.
We gladly accept and review any pull-requests. Feel free!
This project adheres to the Contributor Covenant. By participating, you are expected to honor this code.