lib/jekyll/attendease_plugin/site_page_data.rb
def content
        zones = {}
        keys = %w[content preferences]

        if page['block_instances'].length
          # create zone buckets
          page['block_instances'].each do |i|
            # go through all content
            if site.config.event?
              keys.each do |key|
                i[key].each do |k, v|
                  if placeholder?(v)
                    # maintain the {{ t.foo }} variables
                    v.gsub!(/(\{\{\s*t\.[a-z_.]+\s*\}\})/, '{% raw %}\1{% endraw %}')
                    i[key][k] = render_with_substitutions(v, 'event' => site.data['event'], 'mappable' => site.data['mappable'])
                  end
                end
              end

              unless site.data['mappable'].nil? || site.data['mappable'].empty?
                perform_substitution!(i, 'mappable' => site.data['mappable'])
              end
            end

            zones[i['zone']] = [] if zones[i['zone']].nil?
            zones[i['zone']] << i
          end

          # sort each bucket by widget weight
          zones.each do |k, zone|
            zone.sort! { |x, y| x['weight'] <=> y['weight'] }
          end
        end

        zones.to_json
      end
# Override the accessor:
#
# https://github.com/jekyll/jekyll/blob/v3.3.1/lib/jekyll/renderer.rb#L78
#
# The Jekyll::Rendereer calls document.content, so this seems like the
# best way to set our "page" content with what we want.
#


The Jekyll::Rendereer calls document.content, so this seems like the
best way to set our "page" content with what we want.
The Jekyll :: Rendereer calls document . content so this seems like the best way to set our " page " content with what we want .
def content
        zones = {}
        keys = %w[content preferences]
        if page['block_instances'].length
          page['block_instances'].each do |i|
            if site.config.event?
              keys.each do |key|
                i[key].each do |k, v|
                  if placeholder?(v)
                    v.gsub!(/(\{\{\s*t\.[a-z_.]+\s*\}\})/, '{% raw %}\1{% endraw %}')
                    i[key][k] = render_with_substitutions(v, 'event' => site.data['event'], 'mappable' => site.data['mappable'])
                  end
                end
              end
              unless site.data['mappable'].nil? || site.data['mappable'].empty?
                perform_substitution!(i, 'mappable' => site.data['mappable'])
              end
            end
            zones[i['zone']] = [] if zones[i['zone']].nil?
            zones[i['zone']] << i
          end
          zones.each do |k, zone|
            zone.sort! { |x, y| x['weight'] <=> y['weight'] }
          end
        end
        zones.to_json
      end
def content zones = { } keys = %w[ content preferences ] if page [ 'block_instances' ] . length page [ 'block_instances' ] . each do | i | if site . config . event? keys . each do | key | i [ key ] . each do | k , v | if placeholder? ( v ) v . gsub! ( / ( \{ \{ \s *t \. [a-z_.]+ \s * \} \} ) / , '{% raw %}\1{% endraw %}' ) i [ key ] [ k ] = render_with_substitutions ( v , 'event' => site . data [ 'event' ] , 'mappable' => site . data [ 'mappable' ] ) end end end unless site . data [ 'mappable' ] . nil? || site . data [ 'mappable' ] . empty? perform_substitution! ( i , 'mappable' => site . data [ 'mappable' ] ) end end zones [ i [ 'zone' ] ] = [ ] if zones [ i [ 'zone' ] ] . nil? zones [ i [ 'zone' ] ] << i end zones . each do | k , zone | zone . sort! { | x , y | x [ 'weight' ] <=> y [ 'weight' ] } end end zones . to_json end
Override the accessor:
https://github.com/jekyll/jekyll/blob/v3.3.1/lib/jekyll/renderer.rb#L78
Override the accessor : https : // github . com / jekyll / jekyll / blob / v3 . 3 . 1 / lib / jekyll / renderer . rb#L78
# create zone buckets # go through all content # maintain the {{ t.foo }} variables # sort each bucket by widget weight