Sha256: 6559b4fe9eb98e1ddd67d27452f9f3cbf36d18b6c0d96cecbc123c8eb8da17cc

Contents?: true

Size: 856 Bytes

Versions: 2

Compression:

Stored size: 856 Bytes

Contents

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

          delegate :name, :handle, :domains, :seo_title, :meta_keywords, :meta_description, :asset_host, 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

2 entries across 2 versions & 1 rubygems

Version Path
locomotivecms_steam-1.4.1 lib/locomotive/steam/liquid/drops/site.rb
locomotivecms_steam-1.4.0 lib/locomotive/steam/liquid/drops/site.rb