Making this website

Table of Contents

This post will go over the process I took to make this website for those curious or wanting to go through the process themselves. Broadly the path was purchase a domain, get email for that domain functioning, create a repository in Source Hut for the site and learn how to use a static site generator to create the website.

Self hosting background

Before I get in to the process I should highlight my experience and background so people do not think I started from zero, I have spent the past two years learning to self host my own services where possible with docker, which admittedly was running in Docker For Desktop on a Windows 10 machine using WSL2, these services include my own music server, baby tracker, RSS reader and a Pihole to name a few. Couple this with my career as an engineer in the Industrial Automation space, so I knew the broad strokes of how to do this but no idea on actually implementing it. Background included familiarity with the version control software git (https://git-scm.com/) and using the command line in general.

Purchase domain

This is technically optional as Source Hut allows you to host your static site at username.srht.site but I wanted a domain for two reasons.

  1. To have more control over the URL so that if Source Hut disappears I can just have the domain name point to somewhere else that I host the site.
  2. I wanted to make a clean break from free email accounts and pay to have email hosted on my domain again for more control over the service.

I went with NameSilo, why them over anyone else? No particular reason other than they had and API that looked usable and the mail forwarding looks like a good feature (Even though I did not end up using this). Registering the domain was easy and there was a quick configuration which seems nice, I left this at none as I was not ready to configure anything and I actually planned on using subdomains rather than the main domain (for example blog.bloominstrong.net rather than just bloominstrong.net), so the main domain pointed towards a page that informed people it was “parked” with NameSilo which I did not mind for the time being.

With the domain sorted now to get the email happening.

I was weighing up between MXroute (https://mxroute.com/) and Migadu (https://migadu.com/) either seemed fine but I liked the Migadu pricing based on usage and it had a trial so I could make sure I could set up individual addresses with a combined inbox (I guess trials do work). The DNS setup was easy accept Migadu showed some hostnames as full including the trailing dot but NameSilo did not accept it but after looking further into it NameSilo is actually the one that is not complying to the standard, otherwise the Migadu documentation was great I actually was able to do it all from my mobile with mostly copy and pasting. After DNS I played with aliases and forwards but identities is what I was after but does require extra setup in the client to send email as that identity. The reason I am doing this is to stop my main email from being leaked and then being passed around on spam lists and being able to reduce marketing emails from companies that send lots of emails after a single purchase. My first sent email did go to outlook junk, But that was right after it was created and later emails sent the next day did not go to junk so it may have been waiting for some of the trust to propagate through email networks with my domain.

Email is working so now I can sign up to Source Hut and create the repository that will contain the blog.

Note: If I did not want the blog under my own domain and I was happy with using any email service I could have started here.

I decided to use Source Hut (https://sr.ht/) over Gitlab (https://gitlab.com/) because I like the developer of Source Hut, it seems to have all the features I needed and I like the idea of using git as intended with the email patches (https://git-send-email.io/) , though I am yet to dive into that particular usage. I thought I would have to use the git patch over email to get started but it looks like that is only for submitting patches to other projects instead of a pull request. So just a git remote add and git push got things up there in no time.

Now to the software that will create the website.

I went with hugo as I had seen it mentioned a few times including on Source Hut. Hugo (https://gohugo.io/) uses Markdown (https://www.markdownguide.org/) files so it meant I could just start writing and adjust formatting as needed but admittedly I had not actually learnt Markdown before so that is something I will be learning as I write posts. Also if my needs change my content is not locked away in a database or system that is too much trouble to migrate away from. Hugo is pretty easy to get going you create the site with

hugo new site

and the new site will be generated and choose you theme then when you want to create new content

hugo new content/posts/my_new_post.md

and an outline will be created from the template.

Then to get the static website going I needed to use the build feature of Source Hut which is pretty straight forward with the examples provided (https://git.sr.ht/~sircmpwn/pages.sr.ht-examples) This means that when I push my local copy to source hut it will automatically update my blog with the latest copy. So in theory this was quick job but it took me quite a few iteration as I found that the Source Hut hugo static page example assumed the site name was the repo’s name which was not the case for me and I found the default values did not quite work for me and I admit that it took a few more attempts to work out than I would like to admit.

Everything is setup now lets actually start using it.

To give an idea of my workflow from the command line it would look like this.

  1. Create file for new post

     hugo new content/drafts/my_new_post.md
    
  2. Write post

     nano content/drafts/my_new_post.md
    
  3. Confirm website rendering as expected

     hugo server -D
    
  4. Make edits

  5. Change draft tag in file to false and move to posts

     nano content/drafts/my_new_post.md
     mv content/drafts/my_new_post.md content/posts/
    
  6. Commit to local git and push to Source Hut

     git commit -a
     git push orig
    

And then my new post is up on my blog.