-
Notifications
You must be signed in to change notification settings - Fork 205
How to put the default language in a subfolder? #86
Comments
Good question, I have got the same issue. |
Since the plugin doesn't seem to support this, I have hacked together a basic solution. I had to learn some Ruby (and the basics of Jekyll plugins) first, so it's probably not the prettiest approach. But it's working. To use it, you need to install the plugin manually. If you were using the installed version of the plugin before, be sure to remove the old plugin gems entry from your The modified version does three things:
In a nutshell, when using the modified plugin you should be able to run Note: The modified plugin is currently incompatible with the original (I had to remove and alter some code that relied on the default language being in the root folder), which is why I didn't crate a pull request. As of now, I don't have the time and/or Ruby/Jekyll expertise to reconcile the two approaches, but I'm hoping some of the more experienced contributors can pick it up from here. A basic flag in the |
Definitely in need of out of the box solution. I'd like to use this feature however I don't want to mess with configuring gems manually. |
Same issue here. For consistency I want all languages in their own subfolder. |
@klaasnotfound I panicked when I found out that the plugin couldn't support GitHub Pages, you saved me! You should continue fixing the issue and maybe make a pull request. |
@aumars Yeah, that would be the right thing to do... Unfortunately I currently don't have the time or Ruby skills to work on it. I forgot to mention that I wrote a small blog post on how to use the modified plugin: It provides a bit more detail on how to set up a new site and what to watch out for when using GitHub Pages and i18n. |
@klaasnotfound While I wasn't able to use the plugin, your solution did provide me with what I needed to get a translated website fully working. Thanks! |
I solved this by symlinking the destination root directory to the default language. I do this with a hook: Jekyll::Hooks.register :site, :post_write do |site|
default = site.config['default_lang']
next unless site.config['lang'] == default
puts "Linking default language '#{default}':"
require 'fileutils'
FileUtils.cd(site.dest, verbose: true) do
FileUtils.symlink('.', default, verbose: true)
end
end |
hi i have tested but not working with collections or with paginate-v2 plugin; is possible fix it without use base.html? Thanks |
work around for this issue: Include two times the default language in _config.yml
I recommend to include the canonical url in the HTML header to avoid duplicated content:
|
This is a fantastic plugin - thank you so much for creating it!
One thing that I was unable to figure out is how to configure the plugin so that all the languages (including the default language) end up in a subfolder.
Suppose I have languages
["en", "de"]
. English is the default and put into the root folder. However, for consistency I would like to have the English content in the subfolderen/
, just like the German content, which resides inde/
.Is this possible?
The text was updated successfully, but these errors were encountered: