Sha256: f9f0afae0a834339352232550ec232d61c295d8b51f7c5fa92a5a3a964846510

Contents?: true

Size: 834 Bytes

Versions: 15

Compression:

Stored size: 834 Bytes

Contents

module Locomotive
  module Steam
    module Liquid
      module Drops
        class Site < I18nBase

          delegate :name, :domains, :seo_title, :meta_keywords, :meta_description, to: :@_source

          def index
            @index ||= repository.root.to_liquid
          end

          def pages
            liquify(*self.scoped_pages)
          end

          def metafields
            @metafields ||= Metafields.new(@_source)
          end

          protected

          def repository
            @context.registers[:services].repositories.page
          end

          def scoped_pages
            conditions = @context['with_scope'] || {}
            conditions['slug.ne']   = '404'
            conditions[:published]  = true
            repository.all(conditions)
          end

        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
locomotivecms_steam-1.3.0.rc2 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.1.2 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.2.1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.3.0.rc1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.2.0 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.2.0.rc3 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.2.0.rc2 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.2.0.rc1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.2.0.beta1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.1.1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.1.0 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.1.0.rc3 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.1.0.rc2 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.1.0.rc1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.0.1 lib/locomotive/steam/liquid/drops/site.rb