Html pages are not build with the custom layout file when localization is active.
The html pages are created always with the layout.erb
file even after specifying in config.rb
page "/edelmetalle.html", :layout => "edelmetalle"
If I disable i18n in config.rb edelmetalle.html is build from the edelmetalle.erb layout
My folder structure:
source/
├── fonts
├── images
├── javascripts
├── layouts
│ ├── edelmetalle.erb
│ └── layout.erb
├── localizable
│ ├── edelmetalle.html.erb
│ └── home.html.erb
├── partials
└── stylesheets
build folder:
├── build
│ ├── cn
│ │ ├── edelmetalle.html
│ │ └── home.html
│ ├── de
│ │ ├── edelmetalle.html
│ │ └── home.html
│ ├── en
│ │ ├── edelmetalle.html
│ │ └── home.html
│ ├── es
│ │ ├── edelmetalle.html
│ │ └── home.html
│ ├── ru
│ │ ├── edelmetalle.html
│ │ └── home.html
config.rb:
# Relative paths for assets and custom site_url for the build
configure :build do
activate :relative_assets
set :site_url, "/"
end
# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions
activate :autoprefixer do |prefix|
prefix.browsers = "last 2 versions"
end
activate :i18n, langs: %w[en de ru es cn], :mount_at_root => false
# Layouts
# https://middlemanapp.com/basics/layouts/
# Per-page layout changes
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
# With alternative layout
# page '/path/to/file.html', layout: 'other_layout'
page "/edelmetalle.html", :layout => "edelmetalle"
tried also other options for i18n in config.rb without any positive result, one example:
activate :i18n, :mount_at_root => 'en', :lang_map => { :'en' => 'en', :'es' => 'es' }, :path => '/'