A minimalist static blog generator.
- Super simple
- Write pages in Markdown
- Generates valid RSS 2.0 feed
- Supports code highlighting (using Chroma)
go get github.com/hoffa/pt
Usage of pt:
-base-url string
base URL
-feed string
feed target (default "feed.xml")
-feed-template string
feed template (default "templates/feed.xml")
-highlight string
code highlight style
-template string
page template (default "templates/page.html")
Each page can contain a YAML front matter. It must be placed at the top within ---
delimiters:
---
title: Hello, world!
date: 2019-02-11
---
This is an example page!
Valid variables are:
title
: the titledate
: the creation dateexclude
: ifyes
, the page will be excluded from.Pages
and the RSS feed
First, get the page and RSS feed templates:
curl -L https://github.com/hoffa/pt/archive/master.tar.gz \
| tar -zxf- --strip-components=1 pt-master/templates
Create the index page as index.md
:
---
title: Jane Doe
exclude: yes
---
Subscribe via [RSS](/feed.xml).
And a post within a file called my-first-post.md
:
---
title: My first post
date: 2019-04-20
---
This is an example **Markdown** _post_.
I like `turtles`.
```python
print("Hello!")
```
Finally, build:
pt -base-url https://mysite.com -highlight monokailight *.md
See the Chroma Playground for available syntax highlighting styles.