A web blog and personal homepage engine written in Go.
Go to file
Noah Petherbridge 777fd85085 Dust off gophertype and fix some bugs
* Add a rate limiter to the login page.
* Fix the CSRF cookie expiring after 24 hours; it now will be a session
  cookie that expires on browser exit so you get a fresh one each visit.
* Remove the dependency on go-bindata and use native Go file embed
* Add documentation
2022-12-05 21:09:06 -08:00
cmd Redis cache for Pygmentize + Fragments conflict bugfix 2021-05-31 16:11:01 -07:00
pkg Dust off gophertype and fix some bugs 2022-12-05 21:09:06 -08: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 Dust off gophertype and fix some bugs 2022-12-05 21:09:06 -08:00
go.sum Dust off gophertype and fix some bugs 2022-12-05 21:09:06 -08:00
Makefile Dust off gophertype and fix some bugs 2022-12-05 21:09:06 -08: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.