James Leighton

How I (previously) published my blog

This is a historical post that details the previous iteration of my blog.

This post is to help me remember how to build my blog locally, and publish it to my web host. I don't expect it will be much use to anyone but me in a few months time!

I edit my posts using Visual Studio Code, and I commit the entire pelican folder to a private github repository for storage.

Activating the Virtual Environment

Activating the virtual environment for pelican to ensure all required modules are present.

cd blog
source venv/bin/activate

Building a local site

This command uses a variant of the configuration file configured for local use (eg, the site URL is changed and relative URLs are enabled). It writes the blog to the 'output' folder, and serves it at http://127.0.0.1:8000

pelican content -o output -s pelicanconf.local.py -rl

Building the real site

This command uses the production config and writes the blog to the 'output' folder

pelican content -o output -s pelicanconf.py

Publishing the site

This command uses Rsync to copy the output folder to my host. It is protected by an SSH key with passphrase.

rsync -au -v --stats --progress output/ username@ssh.nyc1.nearlyfreespeech.net:/home/public/

To respond on your own website, write a post which contains a link to this post - then enter the URl of your page here. Learn more about WebMentions.


#How-to