Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
bin
 
 
 
 
 
 
nix
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CircleCI

Pencil

Pencil is a static site generator. Use Pencil to build a personal website, a blog, and more. Pencil comes pre-loaded with goodies such as Markdown and Sass/Scss support, templating, blogging, and tagging. Designed with the Haskell beginner in mind, but flexible enough to extend for your own needs.

The easiest way to get started is to read the tutorials at elbenshira.com/pencil and reference the Haddock docs.

The blue-backed notebooks, the two pencils and the pencil sharpener... the marble topped tables, the smell of early morning... and luck were all you needed. — Ernest Hemingway, A Moveable Feast

Examples

Here's an example that shows a personal website with a blog and an RSS feed. Based off the this example.

{-# LANGUAGE OverloadedStrings #-}

module Main where

import Pencil

config :: Config
config =
  updateEnv (insertText "title" "My Awesome Website") defaultConfig

website :: PencilApp ()
website = do
  layout <- load "layout.html"
  index <- load "index.markdown"
  render (layout <|| index)

  loadAndRender "stylesheet.scss"

main :: IO ()
main = run website config

You can check out other examples. The Blog is a good one.

My personal website (http://elbenshira.com) uses Pencil (source here). And so does Pencil's website at elbenshira.com/pencil (source here).

Development

See DEVELOPMENT.md