Meta Post - Hosting a Pelican Site on GoDaddy
Posted on Sun 22 January 2017 in Tech
After being sufficiently shamed by some of my more tech-savvy friends, I finally broke down and decided to move my personal site out of the 1990s. Rudimentary HTML served me very well, but it was time to try something new. I decided to use Pelican, a static site generator, to create my content. It leverages python, so I have a chance of being able to sort out any errors, allows me to write mostly in MarkDown, and perhaps most importantly, is used by Tim Hopper, who I've followed online for a couple years and somehow solves most technical problems I have, before I know I have them.
Pelican, and static site generators in general, allow you to focus more of your time on content, and less of your time on web development. You select a template that defines the look and feel of your site, modify the configuration file to determine which elements of the template are used and how the site behaves, and then you're in content-only mode. You create a page or post using a shell that looks like this:
Title: Meta Post - Hosting a Pelican Site on GoDaddy
Date: 2017-01-22 14:21
Category: Tech
Tags: pelican, publishing, python
Slug: meta-post-hosting-a-pelican-site-on-godaddy
Authors: Matt Vivier
Summary: Walk-through of how I set up Pelican / GoDaddy to publish my site
After being sufficiently shamed by some of my more tech-savvy friends, I finall...
And you're a quick pelican content_directory -s config_file.py
away from having a rendered website!
It's all the rage to host your website on GitHub Pages, but I have a legacy arrangement with GoDaddy from when I intially bought my domain, so I'll use their hosting for now.
Resources
Procedure
pip install pelican markdown
- I wanted to use markdown instead of restructured text
pelican-quickstart
- This does a great job of stepping through the required options to help you build your
pelicanconf.py
file. I found it helpful to look at the result usingnano
, my editor of choice, and clean out the options I wasn't using. - This aligns with the official Pelican Quickstart, which is a great way to get started.
- This does a great job of stepping through the required options to help you build your
- Initial Setup
- Create content/pages
home.md
contact.md
404.md
- You can add
Status: hidden
to the top of this page to avoid showing it in your list of pages
- You can add
- Create content/pages
- Check it out
- Set
RELATIVE_URLS = True
in youpelicanconf.py
file- This took me way too long to figure out, I couldn't get the links to work properly when viewing on my local machine when it was set to
False
- This took me way too long to figure out, I couldn't get the links to work properly when viewing on my local machine when it was set to
- Generate the pages using
pelican content_directory -s config_file.py
- Start up an HTTP Server in the output directory
cd output
python -m SimpleHTTPServer
- View your page in a web browser at: http://localhost:8000/
- Set
- Share it with the world
- I currently (with my head hung in shame) use GoDaddy's GUI for this, as I'm struggling to get
rsync
working - Go into your output directory (
cd output
) and zip the files (zip -r site.zip *
) - Go into File Manager from GoDaddy's cPanel
- Upload the zip file to the
public_html
folder - Select the zip file and click "extract"
- Go to your domain and bask in the glory
- I currently (with my head hung in shame) use GoDaddy's GUI for this, as I'm struggling to get