Building to multiple directories with i18n

Hey folks

I’m hoping someone can tell me if I’m on the right track or should change course!

I’m using i18n to build out 30 landing pages; all of which have the same structure, but have different stylesheets, copy and images. Right now when I build my project, I’m given a directory based on my locale and an index.html file. This is exactly how it should work and what I was expecting

My hope is I can find a way to have middleman bundle up each landing page into a directory based on the locale and also include the associated styles, images, js etc in each generated directory.

eg:

/landingpage-01

  • index.html
  • /CSS
  • landingpage-01.css
  • /js
  • /images
  • landingpage-02image.jpg

/landingpage-02

  • index.html
  • /CSS
  • landingpage-02.css
  • /js
  • /images
  • landingpage-02image.jpg

Perhaps a bit late, but you can do achieve this by adding the following in the configure :development block

  set :blog_dir, config[:dir] + 'blog' 
  set :css_dir, config[:dir] + 'css'

However, bear in mind that the set :dir is done by the time the application starts, and it will be “hardcode” to the first language in your setup.
I’m myself trying to figure out what to do to make this dynamic.

Cheers
Andrea

Thanks for the response!

I actually found an awesome way using my config file. I forgot that name of the feature and I’ll have to look it up when I get to my destination. Literally typing this in an airport security line :stuck_out_tongue:

However the way I got it working was indeed dynamic!

I would love to hear from you then :slight_smile: