Giter Site home page Giter Site logo

fuku77 / suna Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 698 KB

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

License: GNU General Public License v3.0

HTML 9.86% Shell 89.05% CSS 1.09%
html-template-engine markdown-to-html posix-compliant posix-sh static-site-generator

suna's Introduction

๐Ÿชท 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.

suna's People

Contributors

fuku77 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.