Customised, Stasis-based Static Site Generator
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
dev-resources
docs
resources
src/dragon
test/dragon
.gitignore Regenerated docs for 0.5.0 release. Feb 5, 2018
.projectile Converted to using Component lib. Sep 24, 2017
.travis.yml
LICENSE
Makefile
README.md
project.clj Merge branch 'release/0.5.x' Feb 5, 2018

README.md

dragon

Build Status Clojars Project Tag Clojure version

Customised, Stasis-based Static Site Generator

Contents

About

This is really just a set of functions used for generating a couple of static sites on different projects. The goals of this set of functions are loosely aligned with a nascent LFE project with a cool logo, so I borrowed the name and images for a "Clojure version" :-)

Prerequisites

  • Clone the repo :-)
  • cd dragon
  • export PATH=$PATH:$(pwd)/bin
  • source dev-resources/shell/dragon-bash-autocompletion

Configuration

Every project that uses Dragon to generate static content needs to add some configuration to its project.clj file. Here's an example taken from the Clojang Blog e.g.:

:profiles {
  ...
  :dragon {
    :domain "clojang.lfe.io"
    :name "The Clojang Blog"
    :description "News, Information, & Tutorials for the Clojang Library Collection"
    :dev-port 5097
    :output-dir "docs"
    :posts-path "/archives"
    :feed-count 20
    :cli {
      :log-level :info
      :log-ns [clojang.blog dragon]}}
  ...
  }

Note that by default, Dragon uses a Redis-backed content cache running in a Docker container. If for any reason you can't or won't run Docker on one of your machines, you can run Redis natively (if it's installed) on that machine only by overriding the default with the following profiles.clj file in your blog app's top-level directory (sibling to the project.clj file):

{:dragon {
  :db {:type :redis-native}}}

You may also want to override the default logging, too, while you're checking the setup:

{:dragon {
  :cli {:log-level :debug}
  :db {:type :redis-native}}}

Documentation

The latest docs are available here:

CLI

The project comes with a CLI. The supported commands (and any subcommands) are documented here, but to give you a sense of things, here's the output of dragon help:

$ dragon help
  Usage:

    dragon COMMAND [help | arg...]
    dragon [-h | --help | -v | --version]


  Commands:

    new      Create files of a given type; see 'dragon new help'
    show     Display various blog data in the terminal
    gen      Generate updated static content for a site
    run      Run the dragon site locally as a Ring app
    help     Display this usage message
    version  Display the current dragon version


  More information:

    Each command takes an optional 'help' subcommand that will provide
    usage information about the particular command in question, e.g.:


    $ dragon new help

License

Copyright © 2017, Clojure-Aided Enrichment Center

Apache License, Version 2.0.