The modular static site generator written in bash (also works with dash).
Reads files from the database
directory and renders to the generated
directory.
- run
./generate
- thedatabase
directory will be created byfirstrun
module - open
database
directory - create first page:
- in
pages/sample-page/index.rc
is the page definition - in
pages/sample-page/entrypoint.rc
are names of the scripts that will be rendered pages/sample-page/square.css
is a sample file for testing thepages__copy_file
function called fromindex.rc
pages/home
is an example home page
- in
- create first post:
- example post directory name is
public_0000001_sample-post
, where
public
tells theposts
module that the post is published
0000001
is queue number
andsample-post
is the link to the post (here:/post/sample-post
) - in
posts/public_0000001_sample-post/content.rc
is the content of the post - in
posts/public_0000001_sample-post/meta.rc
are the post metadata - there are empty files in
posts/public_0000001_sample-post/tags
forposts
andposts-tags
modules, only file name is processed
- example post directory name is
- create first post plugin:
- everything is described in
posts-plugins/sample-plugin/plugin.rc
- plugins are displayed under each post
- everything is described in
- put static files in the
static
directory - edit files in the
templates
directory - edit the settings in
defaults.rc.d
The main generate
script defines global variables for all modules - if you need, copy this block, paste to the database/defaults.rc.d/defaults.rc
and edit. You can change shebang in this file.
Modules reads the default settings from modules/*/defaults.rc.d
- do not edit these files. Just copy the chosen config file to the database/defaults.rc.d
and edit - files from the database
directory has higher priority than configs from modules
.
The main settings are defined in database/defaults.rc.d/defaults.rc
- do not delete this file.
You can create bin
directory and put binaries or links in it (see main generate
script).
pages
- for generating static pagestemplates
firstrun
- unpacks the default databaseposts
- renders blog postsposts-tags
- extension of theposts
module which renders lists of all tagsstatic
- copies static filessitemap
- generatessitemap.xml
minify
- css, js and html minifiergzip
- compresses all generated css, js and html files
import-defaults
- imports all variables indatabase/defaults.rc.d
import-includes
- imports all functions frommodules/*/include.rc
- open
modules
directory - create a directory with the module name
- create a
generate
orinclude.rc
file- the
generate
file is executed by maingenerate
script (must be executable) include.rc
is imported bylib/import-includes
- put functions that will be used by other modules- put modules dependencies in
dependencies
file - put the names of the used utils (eg. sed or mkdir) in the
command-stack
- this file will be checked by the maingenerate
script
- the
- you can create
defaults.rc.d/your-module-name.rc
with module configuration (this file will not be imported automatically)