Wednesday, Nov 4, 2015
Pelican is a static site generator written in Python. In this tutorial, we’ll show you how to build your first Pelican site, host the repo with Bitbucket, and deploy the site to Aerobatic.
pip is a package management system used to install and manage software packages written in Python. If you don’t have pip on your machine, you’ll first need to install it.
Once you have pip, install Pelican:
pip install pelican markdown
mkdir -p ~/projects/yoursite cd ~/projects/yoursite pelican-quickstart
At this point, you’ll be asked a series of questions:
In your text editor, create your first post:
Title: My First Pelican Post Date: 2015-11-04 Category: Review Aerobatic kicks butt.
Save it in the
From the root directory of your Pelican site, run:
Your site has now been generated in the
You can get fancy and customize your site with a Pelican theme if you wish, but at this point, your site is ready to host with Aerobatic…
Either using a tool like Sourcetree or from the command line, go ahead and upload your Pelican site into Bitbucket.
In this tutorial, we’re going to keep things simple and upload the whole site into a single master branch, but a common pattern might be to create a separate orphan branch for your output directory and keep it separate from the rest of the Pelican code. If you’re interested, we previously covered orphan branches in our Hugo blog post.
Deploying your Pelican site is as simple as installing the Aerobatic add-on in Bitbucket (a one-time step) and then linking your repo to Aerobatic. Then, with each subsequent
git push to Bitbucket, Aerobatic will deploy a new version of your site.
Make sure that you specify the deployment directory as
/output and if you’re ready to deploy, check the Yes, deploy my site now! option.
Once you click the button, your site will be live in ~15 seconds, complete with CDN deployment and https. To learn more about other Aerobatic features you can add to your Pelican site, check out our docs section.
The demo app is live on Aerobatic at https://pelican-demo.aerobaticapp.com/.