Vilhelm Bergsøe

Creating my website

Sun 28 Aug 2022 - 1 min read

IMPORTANT NOTICE

This blog post is outdated. The website has been migrated to Rust, and the new codebase can be found here. The old code is still available here.

Oh, and here is a blog post about the updated site: Migrating my site to Rust

The Beginning

I've had a domain for a while now, but haven't got around to building a portfolio site until now.

I wanted to do something a little more unique than just finding a nice Hugo theme, generate a static HTML page and call it a day.

Therefore, I decided to create what you're looking at now. A nice little personal website with blog functionality and an admin panel for creating, deleting and updating blog posts.

The logistics

I wanted the website to be very minimal and found this nice template for a minimal responsive website.

I added minimal changes to it including: go templating, simple JavaScript functions for crud functionality and changed a few colors.

The entire website is hosted through go's net/http with the gorilla HTTP router.

The application's architecture is inspired by Matt Ryer's blog post.

I added markdown functionality and HTML sanitizing with blackfriday and bluemonday respectively.

Usage

The actual template is very easy to use. Example instructions are on the GitHub README here.

There are only two endpoints: / and /admin. The admin endpoint is protected by basic authentication using nothing but go's standard library, gorilla's HTTP router and SQLite!

When you start out, you need to add a user to the SQLite database for administration purposes, and you can do that through a simple shell script included in the repository under /tools/createuser.

After that, you can start customizing the HTML pages and creating blog posts through the admin panel.

I hope to showcase some of my future projects on this website and hope this was an interesting read 😀

You can check out the repository here.

tags: [go, website, blog]