fuku77 / suna

A minimalistic, static HTML-templating blog generator written entirely in POSIX-compliant shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸͺ· suna - static blog generator

Suna is:

  • βœ”οΈ Not to be used for practical use, just a fun project.
  • βœ”οΈ A static website generator.
  • βœ”οΈ A Markdown to HTML parser.
  • βœ”οΈ An HTML-Templating Engine.
  • βœ”οΈ Minimal.
  • βœ”οΈ Fast.
  • βœ”οΈ Written in POSIX-Compliant Shell.

⚠️ The parser is incomplete. Tables & multiline code blocks will not work.

πŸ“– Installation & Usage

Clone the git repository.

git clone https://github.com/fuku77/suna && cd suna

Run the script

Simply run the script:

./suna 

You should see some new files & folders inside root. You can take a look at the files to make sure it generated correctly.
You can change the root directory to where you want to host your web server by using --output DIR or by editing config

βš™ Configuration

The program is configured through editing the config file.
You can run suna -h to get a brief explanation of all the command-line options.

outputDir root by default.
templateFile .suna/template.html by default. Default template file used for all files, unless explicitely stated otherwise through rules.
logFile .suna/suna.log by default.
action Default action performed when no action arguments are given. Valid actions can be found inside config.
logSize Maximum size for logFile (in lines).
verbose Default verbosity.

πŸ“š Rules & Variables

Variables are set to their values during parsing.
Variables can be written either inside the template or the markdown source files.

  • Variable syntax: {{ VAR }}
  • Rule syntax:
    <!-- {
      !rule1 "foo"
      !rule2 "bar"
    } -->
    

Variable Value
TITLE The title of the document.
CONTENT Parsed result of the file. This is a special variable, as it can only be used inside the HTML template.

Rule Value
title Used for the TITLE variable. Falls back to the first header in file if not given, otherwise falls back to file name
template Specify a different template for the file. Note that the path must be relative to .suna, so !template "foo.html" will result in .suna/foo.html.

About

A minimalistic, static HTML-templating blog generator written entirely in POSIX-compliant shell

License:GNU General Public License v3.0


Languages

Language:Shell 89.1%Language:HTML 9.9%Language:CSS 1.1%