Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t access text content of now-binary rep #1035

ddfreyne opened this issue Dec 24, 2016 · 0 comments


None yet
1 participant
Copy link

commented Dec 24, 2016

The binary-ness of an item is determined from the :last snapshot, rather than the snapshot that is being requested. It is therefore not possible to access the textual content of a textual snapshot, if the item’s :last snapshot is binary.

Steps to reproduce


  • File content/ with content [<%= @items["/bar.*"].compiled_content(snapshot: :raw) %>]

  • File content/ with content 'I am bar!'

  • File Rules:

    compile '/bar.*' do
      filter :text2bin
    compile '/foo.*' do
      filter :erb
  • File lib/default.rb: do
      identifier :gh_1031_text2bin
      type :text => :binary
      def run(content, params = {})
        File.write(output_filename, content)

When: compiling

Then: Nanoc throws a “cannot access binary content” error.

Nanoc should return the textual content instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.