Static Site Generator

Pencil – Haskell static site generator

Pencil is a static site generator library for building websites and blogs. It provides a collection of functions for loading content, applying templates and writing the resulting pages to a directory. The library is designed to be approachable for developers learning Haskell while providing enough control to create more elaborate websites.

A Pencil website is defined by a program that describes which files to load and how they should be combined. Pages can be nested inside layouts, with variables and content passed between the different components. Pencil includes support for Markdown, stylesheets, blog posts and reusable templates. Developers can also manipulate page paths, create collections of content and generate additional pages from those collections. Unlike a generator driven mainly by configuration files, Pencil makes the site’s structure and generation process explicit in the application code.

This is free and open source software.

Key Features

  • Generates static websites and blogs from source files and templates.
  • Markdown rendering through Pandoc.
  • Sass and SCSS processing for generating CSS stylesheets.
  • Reusable HTML and Markdown templates.
  • Template variables for inserting content and metadata.
  • Conditional blocks and loops within templates.
  • Template partials for including reusable content fragments.
  • YAML preambles for defining page-specific metadata.
  • Configurable global environment variables shared across pages.
  • Nested page structures for combining layouts and content.
  • Collections for processing and displaying groups of related pages.
  • Automatic file extension conversion for supported content types.
  • Functions for renaming, moving and modifying generated page paths.
  • Functions for loading and rendering individual files or complete directories.
  • Pass-through handling for images and other assets that do not require conversion.
  • Blogging helpers for loading posts and ordering them chronologically.
  • Support for post metadata including publication dates and tags.
  • Generates tag archive pages using collections of blog posts.
  • RSS feed generation using the supplied blogging utilities and templates.
  • Environment manipulation functions for modifying template values programmatically.
  • Supports custom content processing and website generation workflows.
  • Includes examples for simple websites, blogs and more complex site structures.

Website: github.com/elben/pencil
Support:
Developer: Elben Shira
License: BSD 3-Clause ‘New’ or ‘Revised’ License

Pencil is written in Haskell. Learn Haskell with our recommended free books and free tutorials.


Related Software

Haskell Static Site Generators
HakyllLibrary for generating static sites
ystStatic websites from YAML and string templates
EmaNext-gen library toolkit for building jamstack-style static sites
EmanoteCreates structured websites from plain-text notes
SlickProvides a small set of tools and combinators for building static websites
BarkIntended to be very simple
ribrib is superceded by Ema

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted