Project

Justicar

0.0
No release in over a year
A Ruby obsessed static website generator that does web development Justice!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.5
~> 0.3.3
~> 0.3.0
 Project Readme

Justicar

Justicar

MIT License Ko-Fi

A Ruby obsessed static website generator that does web development Justice!

Installation

Install the gem:

$ gem install Justicar

Usage

Using the CLI:

$ justicar my_project # <- this generates a new project
$ cd my_project
$ bundle install # <- installs dependencies
$ bundle exec rake build # <- generates the website
$ bundle exec rake serve # <- locally host the project

To deploy using something like Cloudflare Pages use this as the build command:

bundle install && bundle exec rake build

And set the build output directory to build

How it works when your run rake serve:

  1. Preprocess special files in Source Dir
  2. Process remaining files in Source Dir
  3. Copy Public Dir to Build Dir
  4. Write the Source Hash into Build Dir
    • Note this can cause the Source Hash to overwrite files copied from the Public Dir

File types

.html.rb, .css.rb

These files are executed and the resulting string gets saved in a file using its respective relative path as well as using its filename(sans the .rb) as the resulting file's name

.js.rb

These files get read and passed into the Opal parser to generate the resulting javascript. This gets saved in a file similiarly as html.rb files.

.pre.rb

These are files that are executed before the file generation phase but do not get written anywhere. Here you should create a proc and store it in Justicar::PreProcessor (see sample project for an example). These are files generally used for templates or articles where you want a table of contents.

.post.rb

These are files that are executed during the file generation phase but do not themselves get written anywhere. These files are generally used for programmatically generating multiple files (such as creating a bunch of article pages stored in the preprocessor). See sample project for an example.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/realtradam/Justicar.

License

The gem is available as open source under the terms of the MIT License.