Skip to content
/ suna Public

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

License

Notifications You must be signed in to change notification settings

fuku77/suna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪷 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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published