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:

@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