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

Issues while migrating borisschapira.com #2

Open
borisschapira opened this issue Oct 15, 2018 · 3 comments
Open

Issues while migrating borisschapira.com #2

borisschapira opened this issue Oct 15, 2018 · 3 comments

Comments

@borisschapira
Copy link
Contributor

borisschapira commented Oct 15, 2018

I'm trying to migrate borisschapira.com and encounter several issues (branc dev). Right now, the main issue being:

  • No files from _locales seems to be considered during the build. Should I explicit _locales in include: in my _config.yml?
  • The posts outside _locales are built. I have access to {{ locale | inspect }} with the good values, but {{ page.locale | inspect }} echoes nil.

And, last but not least, the build is sloooooow. Like, very. Event with a limit_posts: 1, so the build only concerns my pages and _confs collection, I have to wait ~1m30s for a build. On master, same config, 8-9s. However, the inertia may be related to the previous explained issues: if I manage to solve them, things may go faster…

@ashmaroli
Copy link
Owner

Thank you for opening this issue, Boris.
I shall look into your dev branch and leave feedback in the associate pull request

For pages in _locales to be considered, they should be further nested in a sub-directory named according to the locales..
For example, _locales/en-US/_posts/2015-10-11-some-title.markdown when en-US is not your site's default-locale

Regarding the performance issue, the reason could be due to re-rendering of the pages in the _locales directory

@borisschapira
Copy link
Contributor Author

My posts and pages are nested into fr, en folders, as defined into my configuration. I've put in _locales every translated page or post.

@ashmaroli
Copy link
Owner

I've put in _locales every translated page or post.

Agreed. But I think, there is something missing in my README that has not made things clear for you:
Let me explain with the post at path https://github.com/borisschapira/borisschapira.com/blob/dev/_locales/en/_posts/dad/2018-01-12-chip-n-dale/2018-01-12-chip-n-dale.md

That is the translated version because your site's default locale is "fr"
Okay. For that "path",

              source: https://github.com/borisschapira/borisschapira.com/blob/dev
  base_relative_path: _posts/dad/2018-01-12-chip-n-dale/2018-01-12-chip-n-dale.md
locale_relative_path: _posts/dad/2018-01-12-chip-n-dale/2018-01-12-chip-n-dale.md
  • You do not have to have a "locale copy" for fr locales. They're your original source files.
    Only _locales/en directory needs to contain copies.
  • the base_relative_path and locale_relative_path (example only) should exist on the file system.
    i.e. the following "GitHub urls" should be valid

https://github.com/borisschapira/borisschapira.com/blob/dev/_posts/dad/2018-01-12-chip-n-dale/2018-01-12-chip-n-dale.md
https://github.com/borisschapira/borisschapira.com/blob/dev/_locales/en/_posts/dad/2018-01-12-chip-n-dale/2018-01-12-chip-n-dale.md

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

2 participants