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

Changing attr in preprocess does not cause outdatedness #1216

Closed
ddfreyne opened this Issue Sep 17, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@ddfreyne
Member

ddfreyne commented Sep 17, 2017

Steps to reproduce

Given:

  • an item /cv/ with Haml contents

    - items.find_all('/talks/*/').each do |post|
    %li
        - p post
        = post.identifier
        = post[:status]
  • a few items:

    • /talks/aaa/
    • /talks/bbb/
  • a Rules file

    #!/usr/bin/env ruby
    
    preprocess do
      items.each do |i|
        if i.identifier =~ /talks/
          i[:status] = 'archive'
        else
          i[:status] = 'current'
        end
      end
    end
    
    compile '/**/*/' do
      case item[:extension]
      when 'md'
        filter :kramdown
      when 'haml'
        filter :haml
      end
    
      write item.identifier + 'index.html'
    end
    
    layout '/**/*', :haml

When:

  1. Compiling the site
  2. Changing the condition in the preprocessor to if i.identifier =~ /aaa/
  3. Compiling the site again

Expected behavior

output/cv/index.html is updated (containing “archived” for /aaa/ but “current” for /bbb/)

Actual behavior

output/cv/index.html is not updated (containing “current” for /aaa/ and /bbb/)

Details

When mutating attributes and/or content, checksum_data, attributes_checksum_data and content_checksum_data is not invalidated. It should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment