Open sceee opened 3 years ago
With following settings in _config.yml
:
languages: ["en", "ru"]
exclude_from_localizations: ["js", "images", "assets"]
default_locale_in_subfolder: true
I get next _site
structure:
/images/..
/js/..
/assets/css/..
/en/index.html
/ru/index.html
So it seems to work.
If you set default_locale_in_subfolder
to false
, it will be the same except for the en
folder, because these files will be at the root:
/images/..
/js/..
/assets/css/..
/index.html
/ru/index.html
@g-konst which version are you using?
With 1.6.1
, the issue occurs as described.
@g-konst which version are you using?
With
1.6.1
, the issue occurs as described.
Latest, 1.7
So even if I use 1.7.0 with your config settings, it's not working:
Output directory then only contains
de en
and misses css
etc. directories.
Config is:
languages: ["en", "de"]
default_locale_in_subfolder: true
exclude_from_localizations: ["public", "js", "img", "css", "fonts"]
@sceee check this please. https://www.youtube.com/watch?v=s_8KA6FyLjo
@g-konst thanks for the video but it seems to behave differently on my side. I don't know why it's working on your side but not on mine. But since two other people also upvoted this, I guess they also ran into this issue.
In the end, it just looks like this if I use 1.7.0:
Try disabling all themes or plugins, perhaps one of them overwrites some of the config options. Or to put it another way, try building your project using a different OS (maybe in docker).
Bumping with a related fix: I also ran into this same problem, however I am using a custom source directory. With the config setting source: ./src
I had to also include that path in the exclude options:
exclude_from_localizations: ["src/images", "src/css"]
I've configured my site to do exactly what you do with 1.8.0
/en/index.html
/es/index.html
/images/example.jpg
This feature isn't broken. Since this is > 2 years old, I suggest closing the issue.
@figgles can you share your environment details? I am trying to replicate the solution but it does not work with my env.
@LorenzoDelpi
Gemfile
source "https://rubygems.org"
gem "jekyll", "~> 4.3.2"
group :jekyll_plugins do
gem 'jekyll-multiple-languages-plugin'
end
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
_config.yml
# Build settings
plugins:
- jekyll-multiple-languages-plugin
# Localization
languages: ["en", "es"]
default_locale_in_subfolder: true
exclude_from_localizations: ["assets", "images", "favicon.ico"]
exclude:
- doc/
- assets/sass
In the past, I used the setup I also described here: Have a default language be put to root and in a separate language folder:
Since #170 , it seems there is no way to put the default language to a subfolder but keep static assets in the root. E.g.
It seems that everything specified in
is still put in the default languages's folder:
Of course, I read in the docs that those files should be referenced using a prepend like
Unfortunately, this only works well for html/md files.
In my case, I reference font files (.woff) in sass files - after some googling, it turned out that you cannot simply use
{{ "/fonts/myfont.woff" | prepend: site.baseurl_root }}
in sass files as there are some restrictions that this can only be used in a top-level sass file.So overall, it seems very complicated for a fairly simple thing - I just want all my static assets be on the root so I have a structure like this:
and can just reference those files with a regular
<link rel="stylesheet" href="/css/bootstrap.css"/>
.Is there any possibility to still configure the plugin to produce an output like this with the 1.7 release?