Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: use-case example for a standard multilingual site #5

Closed
ain opened this issue Feb 19, 2014 · 13 comments
Closed

Feature: use-case example for a standard multilingual site #5

ain opened this issue Feb 19, 2014 · 13 comments

Comments

@ain
Copy link
Member

ain commented Feb 19, 2014

Pushing another idea for a documentation feature.

Currently the rough example case puts files into the distribution folders as per tasks defined in Gruntfile.

In real-life scenario though, it's often desirable to have a single template-base and publish it to different langauges automatically. Also given, that it'd be nice to have it automatically populated based on i18n.json, in the circumstances. So the distribution structure would be:

dist
  |
  – en
    |
    –– index.html
    |
    –– about.html
    |
    –– contact.html
  |
  – de
    |
    –– index.html
    |
    –– about.html
    |
    –– contact.html

and so on.

I think it would make a whole lot of sense to produce an example based on this scenario.

@davidyezsetz
Copy link

+ 1

@LaurentGoderre
Copy link
Contributor

In a real scenario though, in the German section would not necessarily have English names.

I agree though that we should have an option between separate folders or file suffix

@ain
Copy link
Member Author

ain commented Feb 19, 2014

I'd combine it with the permalinks plugin. Should be doable and smarter.

@LaurentGoderre
Copy link
Contributor

Fair enough. We'll add it in

@jonschlinkert
Copy link
Member

I'd combine it with the permalinks plugin. Should be doable and smarter.

Indeed, the permalinks plugin would make this easy I think. Especially since you can use lodash templates for variables in the front-matter, then use those variables to build the destination paths dynamically. e.g

In the front-matter:

---
foo: <%= bar %>
---

and in the config:

assemble: {
  site: {
    options: {
      permalinks: {
        structure: ':foo/:basename:ext'
      }
    },
    files: []
  }
}

@ain
Copy link
Member Author

ain commented Feb 19, 2014

@jonschlinkert great stuff, thanks for the comment! I'll play around and probably come back with some additional ideas/reports.

@jonschlinkert
Copy link
Member

👍

@LaurentGoderre
Copy link
Contributor

I'm really impressed by the collective effort! @doowb what is the plan for this? There's a strong push in my project to adopt this ASAP

@kristoferjoseph
Copy link

🍻 This is the exact output structure I am looking for as well.
One template
Many language JSON files
One output directory for each language

@LaurentGoderre
Copy link
Contributor

I think we can close this since it is covered by permalinks?

@jonschlinkert
Copy link
Member

Agreed, I'll close. Please reopen if it seems this isn't resolved.

@ain
Copy link
Member Author

ain commented Mar 4, 2014

Note: we should still create reasonable README with this in mind so devs can pick up the permalinks reference from there. It'll save a few tickets in the long run, I'm sure.

@jonschlinkert
Copy link
Member

yeah I think a good readme will be important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants