satelito

Static [Web] Site (or Page) Generator (SSG) made with Lua script.
git clone git://soucy.cc/git/satelito.git
Log | Files | Refs | README

commit b9356b4d5ee6eec69ea8effe8e0fc9b400e4633c
parent e092a896e9c6060d3b2243cfc38598b0c5b8ec64
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon,  1 Feb 2021 11:12:32 -0500

Comment+indentation

Diffstat:
AREADME.md | 33+++++++++++++++++++++++++++++++++
MREADME.org | 2+-
Msample/config.lua | 9+++++----
Msatelito/list.lua | 30+++++++++++++++---------------
4 files changed, 54 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,33 @@ +# Satelito + +Satelito is a static site generator (ssg) made with lua script. Even +the metadata use lua file, instead *front matter* in yaml or json +embedded inside the markdown file, often seen in other satic site +generators. + +Because Lua data table are pretty simple and allows to execute lambda +function in it. + +## Installation + +To install Satelito, you must have [Luarocks](https://luarocks.org/) +installed on your computer: +<https://github.com/luarocks/luarocks/wiki/Download#installing>. + + * Then in your terminal `luarocks install satelito --local`. + +If the installation went successfully you can test Satelito by invoking the help page: + + * `satelito -h` + + + + +--- + +- `find mySiteSrc/ -name '*.md' | satelito --export` +- `ag '' --markdown -l mySitesrc/ | satelito --export` + +Watch changes `find` et `entr`: + +- `find mySiteSrc/ | entr -s 'echo "Modification!" && find mySiteSrc/ -name "*.md" | ./satelito/satelito --export'` diff --git a/README.org b/README.org @@ -11,6 +11,6 @@ You must have Luarocks installed on your computer. - =find mySiteSrc/ -name '*.md' | satelito --export= - =ag '' --markdown -l mySitesrc/ | satelito --export= -Watch changes =find= et =entr=: + Watch changes =find= et =entr=: - =find mySiteSrc/ | entr -s 'echo "Modification!" && find mySiteSrc/ -name "*.md" | ./satelito/satelito --export'= diff --git a/sample/config.lua b/sample/config.lua @@ -1,7 +1,8 @@ --- --- Website Configuration File --- +--[[ + Satelito website configuration file. + <https://soucy.cc/git/satelito/file/README.md.html> +]] return { domainname = "luvgoude.tld", @@ -10,7 +11,7 @@ return { -- Main paths paths = { - content = 'content/', + content = 'content/', -- where are the source files css = 'public_html/css/', images = 'public_html/images/', public_html = 'public_html/', diff --git a/satelito/list.lua b/satelito/list.lua @@ -9,27 +9,27 @@ local markdown = require 'discount' -- lua-discount local model = require 'satelito.model' function list.build(filepath) - local _list = {} + local _list = {} - do - if file.is_index(filepath) then - local dirname = file.get_dirname(filepath) + do + if file.is_index(filepath) then + local dirname = file.get_dirname(filepath) - for child in dirtree.get(dirname) do - if child - and file.is_markdown(child) - and not file.is_index(child) - then - local child_content = { content = assert(markdown(file.read(child))) } - local child_parameters = assert(model.get(child)) + for child in dirtree.get(dirname) do + if child + and file.is_markdown(child) + and not file.is_index(child) + then + local child_content = { content = assert(markdown(file.read(child))) } + local child_parameters = assert(model.get(child)) - table.insert(_list, lume.extend({}, child_content, child_parameters)) - end - end + table.insert(_list, lume.extend({}, child_content, child_parameters)) end + end end + end - return _list + return _list end return list