Skip to content

Blog written with Go + HTMX meant to be cheap to run anywhere

License

Notifications You must be signed in to change notification settings

guilycst/guigoes

Repository files navigation

Guigoes - A serverless blog using GO and HTMX

This is the source code for my personal blog https://guigoes.com, it was built using Go and HTMX and deployed on Fly.io.

Table of Contents

Introduction

I wanted to create a reasonably performant blog that is cheap to run. Go and HTMX were a perfect fit for this, Go programs tend to be lightweight and has great support for text templating which helps a lot to rendering HTML fragments for the HTMX web app.

Features

  • Responsive design
  • Full-text search
  • Markdown to HTML parsing for blog posts
  • Easy deploy

Technologies Used

Getting Started

You will need

  1. Go 1.1.8 or later
  2. Make

Installation

$ git clone hhttps://github.com/guilycst/guigoes
$ cd guigoes
$ make install

make install will run the shell script install.sh to install some of the dependencies needed to run and build locally:

This step will also run go mod tidy and go mod download so all Go's dependencies are available to run the project.

Usage

First you'll need to change the POSTS_PATH entry on the .env file so it points correctly to the posts dir on this repository

POSTS_PATH="PATH_TO_REPO_HERE/posts/" 
DIST_PATH="./web/dist/"
BLEVE_IDX_PATH="blog.bleve"

Then you can run using $ make run, this will start a local web server at port :8080 with live reloading using air, so changes made to the code should reflect automatically.

Home page

Deploy

This project was initially meant to be deployed on AWS Lambdas, which do reach my goal of being cheap to run, but the sheer number of artifacts that AWS tooling (CDK) generated is kinda off-putting.

So to keep things as simple as possible i`ve opted for Fly.io, but realistic, any hosting solution that can run binaries would do.

License

GNU GENERAL PUBLIC LICENSE Version 3