/shpg

Ruby+ERB based Static HTML Page Generator

Primary LanguageRubyMIT LicenseMIT

Shpg

Ruby + ERB based html page generator. Ambiguously uses the word "Site" to create pages, layouts, granules and assets based structure, and generate the site to produce html pages along with their associated assets.

Page

Page is the single-alone entity that doesn't depend on other entity and the entity considered to be the main content. It goes with a ruby file where data can be initialized and an ERB template where the data initialized from the ruby file is used. It can set layout and includes granules along with passing data into them.

Layout

Layout depends on a page. With passed data from the page, it can also includes granules along with passing data into granules.

Granule

Granule acts like both stand-alone and depended-entity depending on the passing data into itself.

Assets

Assets are not processable files by the generator, which are included by their path. Any of 'em (page, layout, granule) can include them.

Installation

Download the repository:

$ git clone https://github.com/mash-97/shpg.git

make shpg as cd:

$ cd shpg

run:

shpg$ bundle install

and:

shpg$ rake install

or by using gem inside the extracted repository:

shpg$ gem build shpg
shpg$ gem install --local shpg

Usage

After installing the gem, shpg should be available as cli program in the system. So, first we need to create a new site by create_site command. Considering a site with the name mango:

$ shpg create_site mango

A basic structure for the site should be available inside the mango directory with a index page. We can create page by create_page command. Considering a page with the name fazlee:

$ cd mango
mango$ shpg create_page fazlee

After making changes in pages, pages can be generated by generate command.

mango$ shpg generate

In default, the generated contents will be available inside the output directory. The site can be visited by starting a server:

mango$ shpg server

or manually.

Words

It's like a home-made micro-framework. Intended for a specific work to be benefited by.