Static site generator for HTLM templates.
I needed a tool to quickly generate multiple static HTML pages with the same header/footer/navigation.
I didn't need a complete markdown-based static site generator like Hugo or Jykell, but just some simple HTML themes.
So if you're expecting a full-grown magic framework to write your blog, take a look at 'real things'.
I only created Koekr to help me create static websites for clients.
-
Create an
config.toml
file and add some variables to it.
Example of config:[site] title = "Koekr" url = "https://test.com" [copyright] name = "DenBeke" year = 2017
-
Create HTML files in the
pages
directory. The complete content of those files can be accessed inindex.html
like this:{{ .page.content }}
If you want to add variables to your pages, you can do so by writing TOML, enclosed by---
.
Example of a page:--- title = "Hello world!" --- <p>Koekestad!</p>
-
Create an
index.html
page and use the variables you defined.
Example of the index template:<!DOCTYPE html> <html> <head> <title>{{ .site.title }}</title> </head> <body> <h1>{{ .page.title }}</h1> {{.page.content}} <footer> © {{ .copyright.year }} - {{ .copyright.name }} </footer> </body> </html>
-
Put your assets in the
assets
directory. That directory gets copied togenerated/assets
each time you run Koekr. -
Run Koekr from the command line:
$ koekr
Use the
--watch
command line argument if you want Koekr to listen for file changes. Koekr listens for:- Changes in the
assets
directory (not in subdirectories at the moment) - Changes in the
pages
directory (not in subdirectories at the moment) - Changes to the config file
- Changes to the template file (only if it's a single file at the moment)
- Changes in the
-
Profit!