Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imwally/vomit
A repulsive markdown to static html blog engine.
https://github.com/imwally/vomit
Last synced: 11 days ago
JSON representation
A repulsive markdown to static html blog engine.
- Host: GitHub
- URL: https://github.com/imwally/vomit
- Owner: imwally
- Created: 2015-02-27T22:42:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T19:16:48.000Z (over 7 years ago)
- Last Synced: 2024-10-11T02:49:11.294Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vomit
_A repulsive markdown to static html blog generator._
`vomit` feeds on markdown posts and regurgitates a very simple static HTML blog.
The blog is nothing more then a single index page that lists each blog post.## How to use
Two things are required -- `posts/` and `templates/`.
A working directory would look something like this:
```
blog
|-- posts
| `-- 2015-03-05-vomit.md
`-- templates
|-- index.html
|-- post.html
`-- style.css
```Run `vomit`.
```
~/blog$ vomit
```This will generate the static HTML blog inside a newly created `site` directory.
```
blog
|-- posts
| `-- 2015-03-05-vomit.md
|-- site
| |-- 2015-03-05-vomit.html
| |-- index.html
| `-- style.css
`-- templates
|-- index.html
|-- post.html
`-- style.css```
## Posts
Each post must have the file name format `YYYY-MM-DD-some-title.md`. Two
different extensions are permitted, md and markdown.## Templates
Templates make use of Go's [text/template](http://golang.org/pkg/text/template)
package. You can find examples inside this repo's own `templates` directory.
Both templates are applied to the `Post` struct.### post.html variables
```
{{ .Title }}
{{ .FormattedDate }}
{{ .Content }}
```### index.html variables
The index.html template is applied to a slice of `Post`'s. You can range over
them like such:```
{{ range . }}
{{ .Title }}
{{ .FormattedDate }}
{{ .Content }}
{{ end }}
```