Plop is another static website generator with no configuration.
Why? Because, it's faster to build your own website generator than to learn how to use existing ones.
|
7 months ago | |
---|---|---|
LICENSE | 7 months ago | |
Makefile | 7 months ago | |
README.md | 7 months ago | |
go.mod | 7 months ago | |
go.sum | 7 months ago | |
main.go | 7 months ago |
Plop is another static website generator with no configuration.
Why? Because, it's faster to build your own website generator than to learn how to use existing ones.
go install
Create a file src/homepage.md
:
title: Some Title
description: Some article description
template: homepage
uri: index.html
---
My article content.
Create a template file templates/homepage.html
:
{{define "homepage"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ .Title }}</title>
{{ if .Description }}
<meta name="description" content="{{ .Description }}">
{{ end }}
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="/stylesheet.css">
</head>
<body>
{{ .Body | markdown }}
</body>
</html>
{{ end }}
Run plop
to generate the static file:
plop
Run a local HTTP server to preview the result with plop -serve
.
title
: Page titledescription
: Optional article descriptiontemplate
: Name of the Golang templateuri
: HTML file to generatedate
: Date (ISO-8601)rss
: Boolean to indicate if the article should be included into a RSS feed$ plop -h
Usage of plop:
-port string
Port to listen on (default "3000")
-serve
Start local HTTP server
-src string
Sources folder (default "src")
-tpl string
Templates folder (default "templates")