Module: Bridgetown::Localizable
- Included in:
- GeneratedPage, Resource::Base
- Defined in:
- lib/bridgetown-core/concerns/localizable.rb
Instance Method Summary collapse
Instance Method Details
#all_locales ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bridgetown-core/concerns/localizable.rb', line 5 def all_locales result_set = case self when Bridgetown::Resource::Base collection.resources when Bridgetown::GeneratedPage site.generated_pages else [] end matching_resources = result_set.select do |item| item.relative_path.parent == relative_path.parent && item.data.slug == data.slug end matching_resources.sort_by do |item| site.config.available_locales.index item.data.locale end end |