Skip to content

Instantly share code, notes, and snippets.

@denisdefreyne
Created September 12, 2024 06:46
Show Gist options
  • Save denisdefreyne/d539d07a90670130b82bb4a905404383 to your computer and use it in GitHub Desktop.
Save denisdefreyne/d539d07a90670130b82bb4a905404383 to your computer and use it in GitHub Desktop.
# UNTESTED
# In lib/ somewhere
Nanoc::Filter.new(:fetch_snapshot_textual) do |content, params|
item = @items[params.fetch(:item)]
rep = item.reps[params.fetch(:rep, :default)]
compiled_content = rep.compiled_content(snapshot: params.fetch(:snapshot))
compiled_content
end
# In Rules
filter :fetch_snapshot_textual, item: "/about.*", snapshot: :pre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment