Sha256: 60b124e40bbf2cf311ee19055317941044426adbb8aaee77d3816d30ecfdefaa

Contents?: true

Size: 782 Bytes

Versions: 52

Compression:

Stored size: 782 Bytes

Contents

module Scrivito
  module PresetRoutes
    def self.install_into(route_set)
      return if Scrivito::Configuration.scrivito_route_enabled?

      Scrivito::Configuration.with_scrivito_route_enabled do
        route_set.draw do
          scrivito_route '/', using: "homepage", via: :all

          if Scrivito::Configuration.legacy_routing
            scrivito_route ':id(/*slug)', using: "slug_id", via: :all
          else
            scrivito_route '(/)(*slug-):id', using: "slug_id", via: :all

            match ':id(/*slug)', to: 'scrivito/legacy_redirect#index', via: :all, constraints: {
              id: /[a-z0-9]{16}/
            }
          end

          scrivito_route '/*permalink', using: "permalink", format: false, via: :all
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
scrivito_sdk-1.8.1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.8.1.rc1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.8.0 lib/scrivito/preset_routes.rb
scrivito_sdk-1.8.0.rc2 lib/scrivito/preset_routes.rb
scrivito_sdk-1.8.0.rc1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.7.0 lib/scrivito/preset_routes.rb
scrivito_sdk-1.7.0.rc2 lib/scrivito/preset_routes.rb
scrivito_sdk-1.5.5 lib/scrivito/preset_routes.rb
scrivito_sdk-1.6.1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.6.1.rc1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.5.5.rc1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.4.3 lib/scrivito/preset_routes.rb
scrivito_sdk-1.5.4 lib/scrivito/preset_routes.rb
scrivito_sdk-1.7.0.rc1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.6.0 lib/scrivito/preset_routes.rb
scrivito_sdk-1.6.0.rc5 lib/scrivito/preset_routes.rb
scrivito_sdk-1.5.4.rc1 lib/scrivito/preset_routes.rb
scrivito_sdk-1.6.0.rc4 lib/scrivito/preset_routes.rb
scrivito_sdk-1.6.0.rc3 lib/scrivito/preset_routes.rb
scrivito_sdk-1.5.3 lib/scrivito/preset_routes.rb