Skip to content
A minimalist static site generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
templates Remove index.md Apr 28, 2019
.travis.yml
LICENSE Create LICENSE Feb 18, 2019
README.md Update README.md Apr 28, 2019
pt.go

README.md

pt

Build Status Go Report Card

A minimalist static site generator.

Installation

go get github.com/hoffa/pt

Usage

pt -base-url https://my.site *.md

Front matter

title = "Hello, world!"
date = 2019-02-11

Each page can contain a TOML front matter. It must be placed at the top within +++ delimiters.

Valid variables are:

  • title: the content title
  • date: the content creation date
  • exclude: if true, the page won't be included in .Pages

Themes

Just add your CSS in the <head>. For example:

body {
  line-height: 1.5;
  max-width: 40em;
  margin: auto;
  padding: 1em;
}

Example

First, get the page and RSS feed templates:

curl -L https://github.com/hoffa/pt/archive/master.tar.gz \
  | tar xz --strip-components=1 pt-master/templates

Now let's create our index page:

cat > index.md << EOF
+++
title = "Jane Doe"
date = 2019-01-01
exclude = true
+++

Hello, _world_!

This is an example **paragraph**.
EOF

And a post:

cat > my-first-post.md << EOF
+++
title = "My first post"
date = 2019-04-20
+++

This is an example post.

Nothing much to see.
EOF

Finally, build:

pt *.md
You can’t perform that action at this time.