app/services/maglev/get_page_fullpath.rb in maglevcms-1.2.2 vs app/services/maglev/get_page_fullpath.rb in maglevcms-1.3.0

- old
+ new

@@ -42,17 +42,21 @@ Maglev::PagePath.build_hash(page_id) end def build_fullpath(base_url, path) fullpath = [base_url] - fullpath.push(locale) unless same_as_default_locale? + fullpath.push(locale) if prefix_by_default_locale? fullpath.push(path) unless path == 'index' # for SEO purpose) fullpath.push(nil) if fullpath == [nil] # avoid "" as the fullpath fullpath.join('/') end def site @site ||= fetch_site.call + end + + def prefix_by_default_locale? + !same_as_default_locale? end def same_as_default_locale? locale.to_s == default_locale.to_s end