Fork this repo so that you can, after following instructions, have a quick blog setup on github pages with Pelican static generator and Elegant theme
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
about
archives
blog
categories
feeds
images
tags
theme
.placeholder
2019-01-09-11-31-13.png
2019-01-09-11-32-18.png
2019-01-09-11-33-12.png
2019-01-09-11-33-46.png
2019-01-09-11-35-52.png
2019-01-09-11-36-48.png
404.html
README.md
index.html
search.html
sitemap.xml
tipuesearch_content.js

README.md

blog-o-matic by Pablo Iranzo

Table of contents

  1. Introduction
  2. Setup
  3. Test it
  4. WARNING
  5. Going the extra mile
  6. Feedback and wrap up

Introduction

The Idea with this repository, is to have an easy an 'automated' setup of a blog on github pages by following some easy instructions.

You'll need to setup several steps manually (sorry, I can't do that for you), but once done, each time you publish a new article (markdown, asciidoc), the blog will be redeployed showing your new one.

Blog will be using:

  • Git Hub pages for the hosting of the sources and repository
    • Git Hub token to publish new 'website' once a new article is uploaded
  • travis-ci.org for automating the update and generation process
  • 'pelican' for static rendering of your blog from the markdown or asciidoc articles
  • 'Elegant' for the 'Theme'
  • peru for automating repository upgrades for plugins, etc

Setup

  • Fork this repository to your github account, if this is your first 'blog', name it username.github.io if not, it will be published as username.github.io/repository

  • Generate a github token for your account and save securely the value obtained: Generate token

  • Go to travis-ci.org and login with your github account.

    • Enable repository builds (in your profile): Enable travis repository builds
    • And click on 'settings' once done, and define a new environment variable named GHTOKEN with the value obtained in the prior step Define environment variable
      • Click on 'ADD' once done: Add TOKEN value
        • Token will now be saved and ready for use
  • Clone the resulting repository to your system, for example:

    • git clone https://github.com/iranzo/blog-o-matic.git
    • change to the source branch that will contain the code that we'll be using for updating the website.
      • git checkout source
  • Edit new articles in content/ based on the one already provided.

Test it

As of this step, your repository should be already published on https://githubusername.github.io/ with the 'sample' content

You're ready to write a new article, use 'welcome.md' as an example so that you keep useful headers like category, tags, autho, title, publish date, etc (YAML preamble) and save it as 'yourdesiredname.md'.

Once you've written your new article in 'content' folder, perform:

## Add file to repository
git add content/new-article-filename

## Add file to commit
git commit -m "My new article"

## Upload changes to github
git push

After some seconds, https://travis-ci.org will start showing that a new build is in progress, and once it finishes successfully, the resulting webpage will be available via your username.github.io domain.

WARNING

  • peru.yaml is set to use next branch of Elegant theme for pelican, as this setup uses pelican 4.0 and current 'master' doesn't work for it (feed slugs related)

Going the extra mile

  • Elegant does generate a sitemap to submit to web crawlers to ease indexing
    • YOURURL/sitemap.xml can be submitted
    • Google Search Console
      • Will require you to claim the website as yours, for doing so:
        • Check HEADER method
        • customize pelicanconf.py to match the value you received, in the line that says:
          • CLAIM_GOOGLE = 'XX'
    • Bing Webmaster
      • Check HEADER method
      • customize pelicanconf.py to match the value you received, in the line that says:
        • CLAIM_BING = 'XX'
  • Review other settings in pelicanconf.py to customize your blog name, your name, twitter handle, google analytics ID or others, please do check Pelican-Elegant documentation for more information on what can be done.

Feedback and wrap up