Instead of the standard 'hello world', I decided to just run through how I set this blog up using Pelican, a static-site generator.
Creating & Activating a Virtual Environment in Python
[lol@tilde ~]$ mkdir blog
[lol@tilde ~]$ cd blog
[lol@tilde blog]$ python3 -m venv venv
[lol@tilde blog]$ source venv/bin/activate
(venv) [lol@tilde blog]$
Install Pelican
NOTE: I went with defaults for most of the non-blog options, except for time zone. I selected my time zone according this list
(venv) [lol@tilde blog]$ mv ~/public_html/index.html ~/public_html/index.original.html
(venv) [lol@tilde blog]$ pip install pelican markdown
(venv) [lol@tilde blog]$ pelican-quickstart
Welcome to pelican-quickstart v4.1.2.
This script will help you create a new Pelican-based website.
Please answer the following questions so this script can generate the files
needed by Pelican.
> Where do you want to create your new web site? [.]
> What will be the title of this web site? ~lol
> Who will be the author of this web site? ~lol
> What will be the default language of this web site? [en]
> Do you want to specify a URL prefix? e.g., https://example.com (Y/n)
> What is your URL prefix? (see above example; no trailing slash) http://tilde.club/~lol
> Do you want to enable article pagination? (Y/n)
> How many articles per page do you want? [10]
> What is your time zone? [Europe/Paris] America/New_York
> Do you want to generate a tasks.py/Makefile to automate generation and publishing? (Y/n)
> Do you want to upload your website using FTP? (y/N)
> Do you want to upload your website using SSH? (y/N)
> Do you want to upload your website using Dropbox? (y/N)
> Do you want to upload your website using S3? (y/N)
> Do you want to upload your website using Rackspace Cloud Files? (y/N)
> Do you want to upload your website using GitHub Pages? (y/N)
Done. Your new project is available at /home/lol/blog
(venv) [lol@tilde blog]$ nano pelicanconf.py
Change SITEURL = ''
to SITEURL = 'http://tilde.club/~lol'
then press Ctrl+X to save, and Y to confirm the filename.
Get Plugins & Themes for Pelican
(venv) [lol@tilde blog]$ git clone --recursive https://github.com/getpelican/pelican-plugins.git plugins
(venv) [lol@tilde blog]$ git clone --recursive https://github.com/getpelican/pelican-themes.git themes
Create the first post
(venv) [lol@tilde blog]$ nano content/how-to-setup-this-blog.md
and entered this text.
List & Install Themes and Publish Blog
(venv) [lol@tilde blog]$ pelican-themes -v -l
/home/lol/blog/venv/lib64/python3.7/site-packages/pelican/themes/simple
/home/lol/blog/venv/lib64/python3.7/site-packages/pelican/themes/notmyidea
After looking at a gallery of available Pelican Themes, I decided to go with bootlex. Lucky for me, the theme is present in the the ~/blog/themes/bootlex
directory.
(venv) [lol@tilde blog]$ pelican-themes --install themes/bootlex/
(venv) [lol@tilde blog]$ pelican-themes -l -v
/home/lol/blog/venv/lib64/python3.7/site-packages/pelican/themes/simple
/home/lol/blog/venv/lib64/python3.7/site-packages/pelican/themes/notmyidea
/home/lol/blog/venv/lib64/python3.7/site-packages/pelican/themes/bootlex
Now I publish the site, telling pelican to output the static site files to the ~/public_html
directory, to delete the output/
directory, and to use the bootlex theme.
(venv) [lol@tilde blog]$ pelican -d --output ~/public_html -t bootlex
Done: Processed 1 article, 0 drafts, 0 pages, 0 hidden pages and 0 draft pages in 0.28 seconds.
After loading up the site, I wasn't too keen on the bootlex theme. So I re-generated the site content using the previous notmyidea theme.
(venv) [lol@tilde blog]$ pelican -d --output ~/public_html -t notmyidea
Done: Processed 1 article, 0 drafts, 0 pages, 0 hidden pages and 0 draft pages in 0.30 seconds.
Ah...much better.