These are the notes for a workshop I conducted at the Lernwerkstatt in Berlin on May 8th, 2016, and are meant as a reference for its participants. Should it facilitate autonomous learning for anybody else – even better! A presentation is available as well.
Nowadays, anyone can publish a free website within hours, without necessarily being very tech-savvy. I'd like to prove this during the workshop in a quite practical manner. It is aimed at beginners or people without much technical expertise.
After a short overview about the possibilities and a little bit of theory, we'll dive into a specific example. At the end of the workshop, you will be online with a working website – something like a blog. But at that point you should have gotten an idea of how to create differents sorts of websites.
We'll be using GitHub Pages, Markdown, Jekyll and Disqus. This selection of technologies is a good tradeoff – we will need to talk about a couple of technical things, but it gives us a lot of freedom in the long run.
Publishing on the web can be a cheap and easy thing to do, depending on how much you value ease of use, customization, data ownership or price. Let's take a look at the wide spectrum of possibilities, more or less ranging from super easy to super flexible:
Type | Example | Pro | Con |
---|---|---|---|
Social network | Blogging with notes; groups & pages | Closed platform; FB owns your data | |
Publishing platform | Medium | Ease of use; social journalism | Limited to articles; one UI design |
Website builder | Weebly | Ease of use; different website types | Not all features are free |
Blogging platform | Wordpress | Can be self-hosted; themes & plugins | Modification requires tech skills |
Static site | GitHub Pages | Themes, can be totally customized | Markup language; setup required |
Web hosting | Uberspace | Use databases and popular scripts | Costs money; tech skills needed |
Root server | netcup | Install anything you like | Maintenance; security; difficulty |
Home server | Debian | Complete freedom & ownership | Complete responsibility |
Git is a distributed version control system. What does that mean?
While Git is traditionally aimed at a technical audience, GitHub helps making the use of Git more or less a breeze. What exactly is it? It's a web-based Git repository hosting service:
Let's get going. You'll have a working website within minutes:
<your-username>.github.io
index.htm
.
Open it with a text editor, write Hello world!
and save it.
Standard text editors are:Hello world!
, into the upper input field and then commit changes.<your-username>.github.io
.
Your website is already online.Dropping a file onto the repository, like you did with the index.htm
file before, may be suitable for small changes, but it's not ideal for more complex updates.
The usual workflow would be to have a local copy of your project (this means having a folder on your computer containing the repository files) and keep track of the changes with a Git user interface.
GitHub Desktop is such a user interface. It's available for Windows and Mac OS X and recommended for beginners. If you happen to have a Linux installed on your system, I'd recommend SmartGit. We'll be focussing on GitHub Desktop, though. Let's set it up:
+
button to clone your repository.index.htm
you uploaded earlier.During this workshop, you are going to create and edit more text files. While you could do that with the basic text editor of your system, a slightly more advanced editor, like Atom or Sublime Text, is recommended. Atom was initiated by GitHub and provides useful features like syntax highlighting, tabs, a file browser, themes, and more things that can be added via plugins. So let's go get it:
File > Add Project Folder…
View > Toggle Tree View
.index.htm
you know so well already.GitHub Pages are powered by Jekyll. Jekyll is a so called static site generator. It helps you combine different components into a set of web pages. Confusing? Don't worry – you don't have to touch anything Jekyll if you don't want to. There's ready-made themes available for you to use for free, for example at JekyllThemes.io. Let's try one:
Now, before creating your first blog post, let's make sure that theme actually works:
Added Jekyll HPSTR theme
.<your-username>.github.io
.
Now isn't that beautiful.We are now going to start blogging.
First, navigate to your project folder.
You will notice another folder inside called _posts
.
Inside this folder, you will find 8 sample posts.
Delete them – let's have a clean start.
Remember that Git keeps all of your revisions for future reference?
The second revision of your project will always contain those 8 sample posts, so it's safe to delete them now.
If you ever get curious just take a look at the revision history to see how the sample posts have been made.
Inside the _posts
folder, create a new file.
It should have the following structure:
YYYY-MM-DD-friendly-url.md
The date is used for sorting the blog posts; the part after determines the path inside the URL.
The file extension, md
, is for Markdown; we will take a look at Markdown in a moment.
A good example for a file name may be:
2016-05-08-hello-world.md
Open the file in Atom.
At the top of the file, add the following information:
---
layout: post
title: "Hello world!"
description: "This is my first blog post."
tags: [exploring markdown, intro, test]
---
This part is written in YAML
but that isn't anything you need to worry about.
Insert a blank line after the meta block – next up is Markdown.
Wikipedia says:
Markdown is a lightweight markup language with plain text formatting syntax
Lightweight means easy! You don't need to know HTML to format your pages – but you can! Inside a Markdown document, you cannot only use Markdown itself but arbitrary HTML as well.
Check out this GitHub guide about Markdown to get started.
When you're done writing your first post, switch to GitHub Desktop, review your changes, write a commit summary, commit your changes and sync to upload them to GitHub.
There's a couple of interesting files and folders we may pay attention to:
If <your-username>.github.io
isn't enough, you can connect your website with a custom domain.
If you haven't registered a domain already, you should do that now, for example at DomainFactory.
GitHub has written an article about how to proceed.
Freenom offers 5 free domain TLDs:
There's just one catch: Registrants of a free domain don't become owners of that domain which means that you don't have the same rights as usual. For example, their FAQ page states:
For FREE domain names you can register domains for 1 to 12 months. You can renew FREE domain names in the last 15 days of each registration period – 15 days before the expiration date.
(...)
If your website is down for a prolonged period or if your content is unacceptable/not uploaded the domain will be cancelled. Your domain name might then become automatically available for other registrants to register either as a free or as a paid registration.
To keep this workshop documentation as a reference, I'd recommend starring this repository. You can do this at the top right of this page; it adds a bookmark to your profile. Watching it means you get notifications whenever it's updated.
If a question comes up you are always welcome to start a discussion.
Thanks to @hnz101 for pointing me to Freenom.
© 2021 Andrej Stieben – for this workshop
© 2015 Ian Lunn Design Limited – for Sequence.js and its Starter Basic theme
This repository is made available under the CC BY-NC 4.0 license.