= XStatic—Smart Static Site Generator
A smart, static site generator that automatically manages dependencies to
achieve blazing build times with minimal cognitive load. Only new and changed
files, and files upstream of a changed dependency are processed. Renders
markdown or embedded-Ruby (Erb-like) content as HTML.
Supports templates (embedded & layout), which may be included within content
sources or other templates. Document metadata may me added using a plain-text
preamble of key-value pairs. Generates a complete website that can be served by
the built-in WEBrick server.
XStatic is just a Rake application with some magic sprinkled on top.
Markdown and Erb content are transformed with a custom Erb processor. This
allows you to add application logic to your markdown content, for example fetch
records from a database. All other content, such as HTML, CSS, and images, are
hard linked to the destination directory, ready to be served or copied to a
remove production server.
== Examples
Here's an example command sequence to get a project up and running.
$ mkdir myproject
$ cd myproject
$ xstatic init # set up initial project files
$ find . -type f
./content/index.md # markdown content & metadata
./content/default.css # asset to be hard linked under ./site
./templates/layouts/default.erb # layout template used to render index
$ xstatic site # build website under ./site
updated ./site/index # markdown & metadata converted to HTML
$ find ./site
./site # complete static site ready to be served
./site/index # generated HTML file
./site/default.css # hard linked asset
$ xstatic start # start WEBrick server on port 2000
$ xstatic stop # stop WEBrick server
The above sequence can be simplified to a single command:
$ xstatic init site start # and you're ready to go!
== Site Development Process
Just follow this simple 5-step process as you build your site:
- Add assets and content to the content directory.
- Factor out code and data (HTML, Erb, markdown, plain text, etc.) to the
templates directory.
- Create custom layouts in the templates/layouts directory.
- Update the site by running +xstatic+.
- Reload localhost:2000 in your browser to see your changes.
== Links
Homepage :: https://ecentryx.com/gems/xstatic
Ruby Gem :: https://rubygems.org/gems/xstatic
== History
- 2022-02-24, v0.1.0
== License
({ISC License}[https://opensource.org/licenses/ISC])
Copyright (c) 2022, Clint Pachl pachl@ecentryx.com
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.