Blash : Presentation (copy)

Blash is a blog engine (mostly) written in bash.


Blash is a blog engine (mostly) written in bash.

Blash is not only a simple Blog generator, but also a powerfull tool to create complex sites with its template engine.
As the generated site is purely static, you could publish it where ever you want.

Some examples of sites generated by Blash :

License

This software is a fork on the modification I did on baker made by taylorchu. The original version has been released under GPL2. So, Blash is also under GPLv2. But, all subsequent modifications, I did, have been publish under the dual license DSSL & WTFPL. All the future modifications will be released under the dual license DSSL & WTPFL and the original work in GPLv2.

Please consults Blash Licenses.

Features

Blash is full of features, more or less

Usages

Blash is CLI software. This means Command Line Interface. Here are some commands available (execute blash -h to have all commands) :

As this site is also built using blash, and sources provided, you could easily test it, or follow some examples.

Enhance your site

Templates

Templates or Layout is a system where you build your pages, include other pages, make statements, and Blash takes it all and build your site.

All template files MUST have the .md extension.

Templates : structure example

You could for example have a template for the index pages, one for the page containing text only, and another for your photo posts.
All of these pages include a header file. You could have something like this :

``` + templates (dir) : | +- index.md | @include header.md | +- posts.md | @include header.md | +- photos.md | @include header.md | @include js-photo.md | @include css-photo.md | +- header.md | @include css-global.md | +- css-global.md | +- js-photo.md | +- css-photo.md

```

Templates : File structure

A Template file is composed of two parts :

Here is an example :

``` colorcss: blue testing: true @include global-css @if !testing @include {{ colorcss }} @end

A so beautiful test. ```

Templates : Variables

Variable identifier should only use [A-Za-z_]. Notice that any number is not allowed in a variable name.

``` {{ var }}

{{ content }} # embed child layout output ```

Templates : Directives

As you could see, Blash is able to understand directives. Those directives start with a @ and MUST be the first element on a line.
Directives are :

Templates : Directives examples

Example for the @each variable ... @end :

myVar = [ { "title": "first", "content": "example1", }, { "title": "second", "content": "example2", }, ]

is (internally) encoded as:

``` myVar0title=first myVar0content=example1

myVar1title=second myVar1content=example2 ```

and using the following template:

@each myVar {{ idx }} : {{ title }} - {{ content }} @end

becomes: 0 : first - example1 1 : second - example2 Please note the idx variable is used internally by Blash.

Example for the @cmd ... @end :

@cmd for i in {1..10}; do echo "$i" done @end

Templates : Default variables

Currently, Blash is aware of 3 (three) types of pages :

Here is a list of default variables sets by Blash :

Posts configuration

The headers in post indicate how Blash has to gerenerate your HTML :

Blash configuration

Blash is able to load a config file either by itself (if your config file is named blash.conf) or by using the -f filename.
Here are some variables you could change (in fact all could be changed, it will depend on your needs) :

Draft & Hidden posts:

Markdown

It currently uses the implementation from Daring Fireball. As a consequence, perl is needed for blash to work.

blash