satelito

Static [web] site (or page) generator (ssg) made with Lua script.
git clone git://soucy.cc/satelito.git
Log | Files | Refs | README

commit 72a426bc240f59197778b1f12adc7f7b9a7276e3
parent 7dc46e300a3dce52aca31862525cfb17191727d2
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon,  8 Feb 2021 19:42:48 -0500

Add command examples

Diffstat:
MREADME.md | 41++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md @@ -53,7 +53,7 @@ Satelito is designed more like a **static page generator** than a *static site generator* (ssg), because this app is only able to take one markdown at a time, otherwise it will throw an error: - $ satelito -f satelito-sample/content/index.md satelito-sample/content/filmography/moonlight-serenade.md + $ satelito -f ~/satelito-sample/content/index.md satelito-sample/content/filmography/moonlight-serenade.md Usage: satelito ([-f <file>] | [-p]) [-h] [-e] [<command>] ... @@ -62,25 +62,26 @@ one markdown at a time, otherwise it will throw an error: The only way to build multiple markdown files, it's to input them through the pipeline. By example with the `find` program: - $ find satelito-sample/ -name '*.md' | satelito -p + $ find ~/satelito-sample/ -name '*.md' | satelito -p Or with `ag` (the silver-searcher): - $ ag '' --markdown -l satelito-sample/ | satelito -p + $ ag '' --markdown -l ~/satelito-sample/ | satelito -p This choice brings versatility to Satelito. You can render only a part of your web site without the needs to regenerate the whole project. And as the last two examples show, this allows you to use it with other programs in the Unix toolbox. -### Rule of Two +### The rule of two -With Satelito there is no possibility of *front matter* in a markdown -file. If you want metadata for your content you have to create a lua -file that will have the same name as the markdown file. +Like I said above, with Satelito there is no possibility of *front +matter* in a markdown file. If you want metadata for your content you +have to create a lua file that will have the same name as the markdown +file. - -rw-r--r-- 1 hs0ucy hs0ucy 115 Feb 4 15:16 trip-to-the-moon.lua - -rw-r--r-- 1 hs0ucy hs0ucy 801 Feb 4 15:17 trip-to-the-moon.md + -rw-r--r-- 1 hs0ucy hs0ucy 115 Fec 29 15:16 trip-to-the-moon.lua + -rw-r--r-- 1 hs0ucy hs0ucy 801 Fec 29 15:17 trip-to-the-moon.md #### The metadata file anatomy @@ -100,5 +101,23 @@ the basename of the file, then the current datetime. ## Usage -- `find mySiteSrc/ -name '*.md' | satelito --export` -- `ag '' --markdown -l mySitesrc/ | satelito --export` +Build a file with the `-f` option: + + `satelito -f ~/satelito-sample/content/index.md`. + +Search recursively for all the markdown files with `find`, and piped +directly as input to `satelito` with the `-p` flag: + + `find ~/satelito-sample/content -name '*.md' | satelito -p`. + +Same thing but with `ag`: + + `ag '' --markdown -l ~/satelito-sample/content | satelito -p` + +Search for all the markdown files of the first level with `find`: + + `find ~/satelito-sample/content -maxdepth 1 -name '*.md' | satelito -p`. + +Watch change with `entr` to rebuild the project: + + `find ~/satelito-sample/ | entr -s 'find ~/satelito-sample/content -name "*.md" | satelito -p -e && echo "~/satelito-sample rebuilded at $(date +%T)"'`