My Pelican experience so far
Not a particularly extesive write up but, here’s a few points I thought I’d note about things I came across when setting up Pelican.
Themes#
While this blog has only been set up for the sole purpose of giving my ramblings a platform and helping pass whatever knowledge I possess, I also want it to look nice.
After trawling through pelicanthemes I found the theme that is currently in use as of writing, which is Pelican Clean Blog. Pelicanthemes is a really nice site which gives you the ability to brose the themes and choose which is right for you.
S3cmd#
I chose to use Amazon S3 to host this blog, and so to deploy the site I would be using S3cmd. Thankfully if you initially provision your Pelican site with pelican-quickstart
it creates a Makefile that includes an s3_upload
option.
Problem I found was while the s3_upload
option worked in terms of syncing with the S3 bucket, the CSS files were borked and nothing was displaying properly. This was due to the S3cmd trying to do some funky business with the MIME type. To resolve this I edited the Makefile from:
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
to:
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --no-mime-magic
This just essentially stops S3cmd guessing the MIME-type and uses the default type instead.
Virtualenvs#
While the documentation also states it’s best practise to use Virtualenvs, I just want to reiterate how worthwhile it is.
I had a problem initially trying to display articles that had been written in markdown, which I was then able to resolve using Virtualenvs. My Markdown pip installation seemed to be a little spaffed however, I wasn’t aware this was the case and thought the article was somehow incorrect. After some creative swearing and countless re-reads of the documenation, I created a Virtualenv and did a fresh install of pelican
and markdown
.
virtualenv pelican
cd pelican && source bin/activate
pip install pelican markdown
My articles then magically appeared and all was well in the world.