| title | 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
parklife buildCrawl 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.devparklife configOutput the full Parklife config settings.
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.
Tip
Quickly check that the correct URLs are generated when using a --base subpath:
parklife get / --base /foo | grep /link/to/checkTip
Get syntax-highlighting in the terminal by piping the output to bat:
parklife get /my/page | bat -lhtmlparklife helpParklife's CLI is built with Thor so you get the usual parklife help [COMMAND] output.
Run parklife init to create a starter Parkfile configuration file and a bin/static-build script used to generate the full production static build.
Note
parklife init can be safely run in an existing project and will ask before overwriting files (because it's built with Thor).
There are also some flags to tailor the generated files:
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.
Add Rails integration to the Parkfile and bin/static-build.
Add a little ditty to the Parkfile how to integrate with your Sinatra app.
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.htmlWhat version of Parklife is this?