The Parklife CLI
Alongside parklife build there are a few other commands that can be quite handy. Here’s the full list:
parklife buildparklife configparklife get PATHparklife help [COMMAND]parklife initparklife routesparklife version
build
parklife build
Crawl your app to create a static build.
You can also pass a custom --base to override the config.base configured in your Parkfile:
parklife build --base https://parklife.dev
config
parklife config
Output the full Parklife config settings.
get
parklife get PATH can be really useful, it’s basically “view source” for your app and outputs the provided path’s HTML to the terminal. You can also pass a custom --base to override the config.base configured in your Parkfile.
help
parklife help
Parklife’s CLI is built with Thor so you get the usual parklife help [COMMAND] output.
init
Run parklife init to create a starter Parkfile configuration file and a bin/static-build script used to generate the full production static build.
There are also some flags to tailor the generated files:
init --github-pages
Generate an additional full GitHub Actions workflow at .github/workflows/parklife.yml that will build and deploy your site to GitHub Pages whenever you push to the main branch.
init --rails
Add Rails integration to the Parkfile and bin/static-build.
init --sinatra
Add a little ditty to the Parkfile how to integrate with your Sinatra app.
routes
List all defined routes and whether the route has crawling enabled.
Note that this lists Parklife’s routes not your app’s routes. It’s likely that you’ve configured Parklife to crawl from the root which should encounter the vast majority of your site’s pages but will not list them here.
Example:
$ parklife routes
/ crawl=true
/feed.atom
/sitemap.xml
/easter_egg crawl=true
/404.html
version
What version of Parklife is this?