* 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
|2 months ago|
|cmd||2 years ago|
|pkg||2 months ago|
|public_html||3 years ago|
|pvt-www||2 months ago|
|.gitignore||3 years ago|
|Makefile||2 months ago|
|README.md||2 months ago|
|go.mod||2 months ago|
|go.sum||2 months ago|
This is a simple web blog engine written in Go.
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.
pygmentize program should also be available if you want code
highlight in Markdown.
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
gophertype -debug -sqlite database.sqlite -root ./public_html
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.
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
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.
Copyright 2022 Noah Petherbridge, all rights reserved.