Thanks to the following tutorials:

I've been able to update my website to use a Bootstrap 3 theme for Pelican, pelican-bootstrap3, and hosted on GitHub.io.

Further notes on using custom domain with Github user page

In case this is helpful to anyone, because this was tricky, here are some instructions on how to set up an apex and www sub-domain with a Github user page, see also GitHub quickstart guide for setting up a custom domain. My apex domain is krisyu.org. My www sub-domain is www.krisyu.org. I host my website with DreamHost.

After you've followed the directions under User Pages in the Pelican documentation for publishing to github, do the following:

  1. Create a content/extra directory, and create a CNAME file in this directory with just the custom domain; then make sure to modify pelicanconf.py static path settings to tell Pelican to copy this file to output.

    STATIC_PATHS = ['images', 'extra/CNAME'] EXTRA_PATH_METADATA = {'extra/CNAME': {'path': 'CNAME'},}

  2. Confirm that your Github user page is being published to your custom domain.

    • See `Confirming your custom domain setup on GitHub at the bottom of this page.
    • In the settings of my repository krismyu.github.io, it says, under GitHub Pages,

      Your site is published at http://www.krisyu.org.

  3. Configure an ANAME record with your DNS provider (for me, DreamHost).

    • Set hosting preferences for the apex domain to DNS only (no web hosting), for DreamHost, under Manage Domains, (hat tip here, from Abizern, also here from Andrew F).
    • Under Manage Domains click on DNS for the apex domain. In the section Add a custom DNS record to your-apex-domain, leave Name field blank, and then type in the first IP address provided by Github documentation in the section Configuring A records with your DNS provider in the Value field and click on Add Record Now!. Do the same thing with the second IP address provided in the documentation.
  4. Configure a CNAME record with your DNS provider (for me, Dreamhost).

    • Make sure that your sub-domain is not registered! Under Registrations, if you see your sub-domain registered, delete it. (If you don't do this, you'll get a Not Found error when you visit your apex or sub-domain.)
    • Then add a CNAME file for your sub-domain, following the instructions from GitHub documentation. For Dreamhost, under Manage Domains click on DNS for the www sub-domain. In the section Add a custom DNS record to your-apex-domain, fill in www in the Name filed, and type YOUR-GITHUB-USERNAME.github.io. in Value, e.g. krismyu.github.io. You must have that trailing period.
  5. Check that your DNS record is set up correctly using dig, see Step 4 for GitHub documentation for setting up an apex domain and also for setting up a www sub-domain.

    • Here's an example of the output I got from dig before the changes I made to the DNS entries propagated, for www.krisyu.org.

      ~/web/website(master) $ dig www.krisyu.org +nostats +nocomments +nocmd
      
      ; <<>> DiG 9.8.3-P1 <<>> www.krisyu.org +nostats +nocomments +nocmd
      ;; global options: +cmd
      ;www.krisyu.org.            IN  A
      www.krisyu.org.     10463   IN  A   208.113.172.21
      ~/web/website(master) $ dig www.krisyu.org +nostats +nocomments +nocmd
      
    • Here's the output I get from these commands now that the changes I made to the DNS entries has propagated, for krisyu.org

      ~/web/website(master *) $ dig krisyu.org +nostats +nocomments +nocmd
      
      ; <<>> DiG 9.8.3-P1 <<>> krisyu.org +nostats +nocomments +nocmd
      ;; global options: +cmd
      ;krisyu.org.            IN  A
      krisyu.org.     14400   IN  A   192.30.252.154
      krisyu.org.     14400   IN  A   192.30.252.153
      
    • Here's the output I get from these commands now that the changes I made to the DNS entries have propagated, for www.krisyu.org

      ~/web/website(master *) $ dig www.krisyu.org +nostats +nocomments +nocmd
      
      ; <<>> DiG 9.8.3-P1 <<>> www.krisyu.org +nostats +nocomments +nocmd
      ;; global options: +cmd
      ;www.krisyu.org.            IN  A
      www.krisyu.org.     14400   IN  CNAME   krismyu.github.io.
      krismyu.github.io.  3600    IN  CNAME   github.map.fastly.net.
      github.map.fastly.net.  2   IN  A   23.235.39.133
      
  6. It may take some time, on the order of hours or more, for the changes you made to the DNS entries to propagate. You can check the status of propagation across the globe for your domains here.


Comments

comments powered by Disqus