To start with I wanted to get a domain. I didn’t have to get one and could have just used something like Github Pages which would give me a url like
meme-lord.github.io but it’s nice to have your own domain so that you aren’t tied in to hosting at a specific provider.
I came up with a few domain ideas and found that 0daysto.live was available by doing a whois lookup.
Next I looked up domain registrars on tld-list.com to get it for a cheap price. The “Best 3 Year Value” column is really useful as registrars normally charge low on first year and bump up the price upon renewal.
After getting the domain I changed the domain nameservers on the registrar panel to Cloudflare so that I can manage the DNS from there.
Since this website is going to be static (no server side code running) I decided to host it in an S3 bucket on Scaleway. This is free as long as the traffic is below 75GB a month. If I have Cloudflare caching most of the requests it’s very unlikely it will go above this.
To use the bucket website feature the name of the bucket must match the domain of the website so I called mine 0daysto.live then I clicked “Enable bucket website” under “Bucket Settings”.
Next I needed to point my DNS records to the Bucket Endpoint so that when someone visits the domain the contents of the bucket are shown. So back on Cloudflare I create a CNAME on the root ("@") and provide my bucket domain. Normally this wouldn’t work but Cloudflare do CNAME flattening to make it happen.
Now I need to put stuff in that bucket!
I made a git repo for the site and set up rclone for syncing the S3 Bucket.
~/.config/rclone/rclone.conf looks like this:
type = s3
provider = Scaleway
access_key_id = REMOVED
secret_access_key = REMOVED
region = nl-ams
endpoint = s3.nl-ams.scw.cloud
acl = private
bucket_acl = private
You can get your API keys from Scaleway here: https://console.scaleway.com/project/credentials
I made two basic files just to test everything - the index.html and the error.html, and I put them in a subfolder called public.
Here is the script I use to deploy the site:
rclone sync --progress public/ scaleway-ams:0daysto.live
So now when I’ve made changes locally I just need to run
./deploy.sh and the site will be updated.
Hugo is a static site generator that lets you create a website from Markdown files using templates. I chose it because I’ve used it before on other sites but there are other popular generators you can use like Jekyll.
To create the hugo project:
hugo new site 0daysto.live
For my site I’m choosing to make my own theme but there are many themes available if this isnt something you want to do: https://themes.gohugo.io/
I followed this guide for making my own Hugo theme: https://retrolog.io/blog/creating-a-hugo-theme-from-scratch/
I strongly believe there is way too much bloat in websites these days and these links talk about that general idea:
It can be hard to choose colors, you could consider using a color scheme someone else has made: https://themer.dev/
CSS cheatsheet: https://htmlcheatsheet.com/css/
Setting up a static website can be a straightforward and cost-effective option for individuals and businesses looking to establish a web presence. With the use of a static site generator and a hosting provider, you can easily create and publish a website without the need for extensive coding knowledge. Additionally, static websites are known for their security, speed, and reliability, making them a reliable choice for anyone looking to build a website that is both user-friendly and efficient. Overall, the process of setting up a static website may require some initial time and effort, but the benefits it offers make it well worth the investment.