untra / polyglot

:abc: Multilingual and i18n support tool for Jekyll Blogs
https://polyglot.untra.io
MIT License
416 stars 59 forks source link

jekyll-polyglot removes any images generated by jekyll_picture_tag #152

Open kylekirkby opened 2 years ago

kylekirkby commented 2 years ago

Hi @untra ,

We're using the jekyll_picture_tag plugin to generate webp images for our sites. With the addition of jekyll-polyglot this has broken. Jekyll_picture_tag places the generated images inside the assets/images of the output site folder as the site is building. When the site build ends, it appears that jekyll-polylgot is removing all of these generated images and simply replacing the folder assets/images folder that exists in the base of the repo.

Any ideas how we can stop this happening?

As a work-around I've had to set the output folder for generated images to a folder at the root of the repo (outside of the build folder). This then gets copied in as expected.

# -------- jekyll_picture_tag --------
picture:
  nomarkdown: false
  suppress_warnings: true
  source: ""
  output: "../generated"
  relative_url: true
  disabled: false

# Jekyll-polyglot
i18n_enabled: true
languages: ["en", "ja"]
default_lang: "en"
exclude_from_localization:
  ["javascript", "images", "css", "public", "assets", "generated"]
parallel_localization: false
kylekirkby commented 2 years ago

Possibly an issue with this file? https://github.com/untra/polyglot/blob/master/lib/jekyll/polyglot/patches/jekyll/static_file.rb

timbms commented 4 months ago

Is there an update to this issue?

jimboolio commented 1 month ago

I do not encounter this issue, I'm using both plugins and images do show up on translated blog post. Here is my working code, sorry it's a mess, it's my first time trying Jekyll: https://codeberg.org/jimbo/web/src/commit/d9a5add6c516e315c8123e5eba765d9ab923a576d720a91078cc434e103444d2