module Polites::Nanoc
The {Polites::Nanoc} module provides integration with the [Nanoc](nanoc.ws) static site generator. It allows you to configure a Polites
external directory as a data source in a Nanoc
site, so you can transform Polites
files straight into HTML documents.
This gem consists of the following parts:
-
{Polites::Nanoc::DataSource} implements the data source that reads .ulyz files from disk and creates
Nanoc
HTML items from them. -
{Polites::Nanoc::EmbeddedImagesFilter} implements a filter you can use to transform the image paths in your HTML to the pats generated by your
Nanoc
rules. -
{Polites::Nanoc::ExtractFileFilter} is a filter that will extract embedded files from the .ulyz zip file to actual output files on disk in your
Nanoc
site.
@example Nanoc
configuration using Polites
data source
# in nanoc.yaml data_sources: - type: polites items_root: /articles/ path: path/to/articles
@example Require Ulussyes::Nanoc in your site
# lib/default.rb require 'polites/nanoc'
@example Nanoc
rule to compile Ulussyes articles
compile "/articles/*.ulyz" do filter :polites_embedded_images layout "/default.*" write item.identifier.without_ext + "/index.html" end
@example Nanoc
rule to extract embedded media
compile(%r{\A/articles/.+\.ulyz/media/.+\Z}) do filter :extract_file write item.identifier.to_s.sub(".ulyz", "") end