A couple of days ago I published a new “about” page for introducing myself.
I’ve always struggled to find the best way to brand myself in a way that completely satisfied me. In the past, I only had a landing page linking to the various profiles and networks I wanted to highlight like WordPress.org, GitHub, Twitter, etc.
However, I also wanted a space where I could write. I sometimes feel the need to write about things, or express a point of view about a trending topic. For that, I need a blog where I can write whatever I want, whenever I want. The downsides are:
- I am not a regular writer,
- I am not a native English speaker, which means my writing is not too pleasant to read
For those reasons I’ve been tempted to just close the blog and go back to a simpler landing page on this domain. However, I know that there’s going to be a day where I want to write something and I’ll be wondering where to do that. Again, not being a native English speaker kind of stops me from writing on Medium or the likes.
Then one day I asked myself why not have both? I could keep the blog for when I need to write, and have a simple one page site that I can direct people to when I just need to say who I am.
This idea got even more interesting when I realized I could make it fun. I know it is possible to host a simple site on GitHub but I’ve never done it. It was the perfect time.
Hosting on GitHub
Hosting a site on GitHub is pretty simple. The only thing you have to limit yourself to is only write HTML. No server side language can be used.
As design and front-end development are far from being my specialty, I decided to use the theme Coffee & Cream by ocholabs. The code is very clean and well commented, which makes it easy to customize it.
After tweaking the code a bit, changing the colors and removing the sections I don’t need, I needed to solve the one problem that the HTML limitation causes: handling the contact form.
Indeed, with no server-side language allowed, it is not possible to handle the contact form directly from the site.
Luckily, there are a couple of services out there that are built to do just that: handling POST data. I’ve opted for FormSpree which is dead simple to use. There is one thing that I don’t particularly like though: your e-mail address can be seen in clear in the source code. Not a huge deal but I’m always afraid of bots.
Using FormSpree with an HTML form is as simple as specifying the FormSpree domain in the form action.
<form action="//formspree.io/your @email.com" method="POST"> <input type="text" name="name"> <input type="email" name="_replyto"> <input type="submit" value="Send"> </form>
Pushing to GitHub
Once everything is ready, the last thing you need to do is push your code on GitHub. There are actually two ways to do it.
If you’re hosting a product / application on GitHub and you are publishing a small site for that application, obviously your codebase is on the
master branch of your repo. You will need to push on a new branch called
If you’re publishing a site for yourself (or for your organization), you’ll use a dedicated repository for the site. You will need to name the repo
username is your actual username. My repository for instance is called julien731.github.io. In this case, your site will be pushed on the
master branch of this repo.
Pointing your domain
Now you just need to set things up so that your domain points to the repo. Two simple steps are needed.
- Go to your registrar control panel (I personally use NameCheap) and set a new
CNAMErecord for the desired domain. This record should point to
username.github.io(don’t forget to replace
- Add a new file to your repository and call it
CNAME(no extension). In this file, simply write the custom domain name that you wish to use (do not add the
It is worth noting that you can use a TLD (domain.com) or a subdomain (about.domain.com).
After the new record is propagated and the
CNAME file is pushed to the repository, your custom domain will be used instead of the