Getting started with spork-site

spork-site 0.1.1

Configure a source factory, synchronize the provider, and understand the publishing model.

A site is an ordinary source-only Spork project. Add spork-site, configure :site :target, and return an immutable site value from that source function. The package owns the complete spork site command; no separate application entry point or Python adapter is required.

Minimal site#

Create spork.it at the project root:

{:name "example-site"
 :version "0.1.0"
 :spork-version ">=0.6,<0.7"
 :dependencies ["spork-site>=0.1,<0.2"]
 :source-paths ["src"]
 :site
 {:target "example.site:make-site"
  :watch ["spork.it" "src" "content" "static"]}}

Then define the configured source function in src/example/site.spork:

(ns example.site
  (:require
    [spork-site.build :as build]
    [spork-site.core :refer [element fragment markup]]
    [spork-site.routing :as routing]))

(defn make-site []
  (build.site
    * :output "public"
      :pages
      [(routing.page "/"
         (markup
           ($main
             ($h1 "Hello from Spork")
             ($p "This page is an immutable node tree."))))]))

Synchronize dependencies once, validate the complete plan, and build:

spork sync
spork site check
spork site build

The generated homepage is public/index.html. Continue with builds and commands for output safety and the full command reference, or start development serving.

Capabilities#