Setting up a Pelican Blog on Windows

A first post on how I built this simplistic static blog/personal website using Pelican and hosted it on Github Pages.

With my limited proficiency with JavaScript and HTML, I chose Python and Pelican for my personal website. Offering a variety of cleam and minimalistic themes, and plugins, Pelican is a great tool.
Now there are a number of good examples to work from and tons of resources to help you build your own blog using Pelican. This post is just to offer some tips to ease the process.

Windows

I work with Windows and so it's tricky to get the 'make' command to work. Instead you can use batch files for the same purpose.

  • Create the '/output' directory using 'pelrun.bat':
$ pelican content --debug --autoreload  --output output --settings pelicanconf.py
  • Serve the output HTML code using 'pelserve.bat':
$ pushd output
$ python -m pelican.server
$ popd

Visit [http://localhost:8000/] to see the result.

  • Publish the output using 'pelpub.bat':
$ pelican content --output output --settings publishconf.py
  • To further simplify the process, make a single, all-powerful 'pelall.bat' combining the code from all batch files given above.

Using Jupyter notebooks in MarkDown articles

You might encounter the following error from the 'liquid_tags' plugin while compiling your output:

store() got an unexpected keyword argument 'safe'

This is because recent changes made to the libraries have deprecated 'safe'. This can be fixed by forcefully installing an outdated version of nbConvert. Although not a permanent fix, this gets the job done. Execute the following code from the command line:

$ python -m pip install -U markdown==2.6.11 --force-reinstall

Miscellaneous Tips

  • Add an e-mail subcription list, and automate it with MailChimp. Embed your unique MailChimp URL into your Pelican theme's template to direct your readers to your e-mail subscription list.
  • Add your Google Analytics unique ID to monitor visitor activity on your blog.
  • Github Pages' Error:404 is quite boring. Make your own hilarious Error:404 redirect webpage. Check mine out for inspiration.

Resources

Apart from the Pelican documentation, these resources are helpful:

My own blog's source Source
A Windows centric guide Here
danielfrg's theme Here
A well explained guide Here

These tips and tricks will help Windows users to reduce their blog's set-up time.

© 2017 Ayush Yembarwar | Source