https://github.com/elben/pencil
Static site generator in Haskell
https://github.com/elben/pencil
haskell haskell-library static-site-generator
Last synced: 10 months ago
JSON representation
Static site generator in Haskell
- Host: GitHub
- URL: https://github.com/elben/pencil
- Owner: elben
- License: bsd-3-clause
- Created: 2018-01-31T05:25:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-17T17:30:55.000Z (over 6 years ago)
- Last Synced: 2025-04-14T01:52:35.359Z (10 months ago)
- Topics: haskell, haskell-library, static-site-generator
- Language: Haskell
- Size: 740 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/elben/pencil/tree/master)
# 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](http://elbenshira.com/pencil) and reference the [Haddock
docs](https://hackage.haskell.org/package/pencil).
> 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](https://github.com/elben/pencil/tree/master/examples/Simple).
```haskell
{-# 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](https://github.com/elben/pencil/tree/master/examples). The [Blog](https://github.com/elben/pencil/tree/master/examples/Blog) is a good one.
My personal website (http://elbenshira.com) uses Pencil ([source here](https://github.com/elben/elben.github.io)). And so does Pencil's website at [elbenshira.com/pencil](http://elbenshira.com/pencil) ([source here](https://github.com/elben/pencil/tree/master/examples/Docs)).
# Development
See [DEVELOPMENT.md](DEVELOPMENT.md)