A web blog and personal homepage engine written in Go.
Go to file
2023-07-01 16:04:02 -07:00
cmd Code cleanup 2023-07-01 16:04:02 -07:00
pkg Code cleanup 2023-07-01 16:04:02 -07:00
public_html Pretty Logger and Persistent App Settings JSON 2019-11-26 11:17:01 -08:00
pvt-www Dust off gophertype and fix some bugs 2022-12-05 21:09:06 -08:00
.gitignore Age Gate, Legacy kirsle/blog Migration Program 2020-02-17 15:50:04 -08:00
go.mod Code cleanup 2023-07-01 16:04:02 -07:00
go.sum Code cleanup 2023-07-01 16:04:02 -07:00
Makefile Code cleanup 2023-07-01 16:04:02 -07:00
README.md Dust off gophertype and fix some bugs 2022-12-05 21:09:06 -08:00

Gophertype

This is a simple web blog engine written in Go.

Dependencies

This app expects you to have a Redis cache server running on localhost. Redis is used for rate limiting and to cache Pygments code highlight blocks in Markdown files.

The Python pygmentize program should also be available if you want code highlight in Markdown.

Usage

For database, this app can use SQLite, MySQL or PostgreSQL; use one of the options. Easiest is to use a SQLite database for local development.

Usage of gophertype:
  -bind string
    	Bind address for HTTP server (default ":8000")
  -debug
    	Debug level logging
  -mysql string
    	Use MySQL database, format: user:password@/dbname?charset=utf8&parseTime=True&loc=Local
  -postgres string
    	Use Postgres database, format: host=myhost port=myport user=gorm dbname=gorm password=mypassword
  -root string
    	User root for custom web pages (default "./public_html")
  -sqlite3 string
    	Use SQLite database, default 'database.sqlite'
  -v	Show version number and exit (alias)
  -version
    	Show version number and exit

Example:

gophertype -debug -sqlite database.sqlite -root ./public_html

Architecture

Gophertype runs on a dual templating system: it has its own built-in store of default pages to run the core features of the blog, and a public user root for your own pages and you can override the built-in defaults by creating files with the same name.

The pvt-www/ folder contains the built-in templates (these get bundled into the binary when compiled), and public_html is the default user root (which you can change with the -root command line parameter).

Pages and Markdown Support

Everything under the user root is basically served as static files from disk, so you can arrange images and JavaScript paths and embed everything as normal.

A couple types of files are handled specially:

  • Go templates (*.gohtml) are processed with the html/template module.
  • Markdown files (*.md) are supported and will render as HTML wrapped in an HTML template providing your blog's normal layout and decorations.

License

Copyright 2022 Noah Petherbridge, all rights reserved.