Siteleaf CLI
We recommend using GitHub Sync for local development, but you can use the Siteleaf command line interface (CLI) if that’s your preferred workflow.
The Siteleaf CLI ships as an open source Ruby gem. To fork and contribute see: https://github.com/siteleaf/siteleaf-gem
Local development using the Siteleaf CLI
1) Create a file called Gemfile
in your site’s root folder and add the Siteleaf gem and Jekyll to your bundle:
For help with Bundler or Gemfiles, please see: http://bundler.io/gemfile.html
2) Install the bundle:
3) Authorize your Siteleaf account:
4) Create or connect to a Siteleaf site:
To create a new Siteleaf site:
This will create a new theme folder called yoursite.com
in the directory where you ran this command. It will also create the site for you in your Siteleaf account. If you prefer not to create a new directory, run bundle exec siteleaf new yoursite.com .
instead.
To use an existing Siteleaf site:
You can then pull the Jekyll configuration, content, and current theme:
5) Start the Jekyll server:
Now visit localhost:4000 to see your site!
5) Push your content and theme to Siteleaf:
Important: When using push
/pull
in v2, both theme and content files are included. Always make sure to do a pull
first to avoid overwriting your Siteleaf content on push
. Your local directory must have a _config.yml
in order to push.
Backing up your site
Creating a full backup of your site is simple. Just copy your Gemfile
to an empty directory and do a pull
:
This will include your entire site, including theme files, assets, content, and site metadata.