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

_data files in theme gem don't appear to load #7

Closed
mmistakes opened this issue Dec 14, 2016 · 3 comments
Closed

_data files in theme gem don't appear to load #7

mmistakes opened this issue Dec 14, 2016 · 3 comments

Comments

@mmistakes
Copy link

Very useful plugin. I gave it a go to see if I could integrate it with my theme gem so users don't have to copy a file with all of the UI text's translation.

Here's what I tried:

  1. Add spec.add_runtime_dependency "jekyll-data", "~> 0.4" to my theme's gemspec
  2. Went into my theme gem's /test folder ran bundle update and verified jekyll-data installed and was added to Gemfile.lock
  3. Changed locale: en in /test/config.yml to fr to test if the UI text strings change from English to French.
  4. From the theme gem's root ran bundle exec rake preview to fire up a test site at http://localhost:4000/test
  5. Observed no change to the UI text.

If I copy _data/ui-text.yml to /test/_data/ui-text.yml the French translations appear. I also tried adding gem "jekyll-data" to the Gemfile in /test and that made no difference.

https://github.com/mmistakes/minimal-mistakes/tree/feature/jekyll-data

@ashmaroli
Copy link
Owner

Thank you for trying the plugin and opening this ticket @mmistakes .
looks like I was wrong about runtime_dependency plugin not needing to be added to the site's _config.yml
My apologies..

adding jekyll-data to the gems: array in your test site's _config.yml should resolve this.
Another way to check if Jekyll reads _data folder is by serving with the --verbose switch. Though, in your theme's case, the humongous data hash is probably going to cascade relevant information.

@mmistakes
Copy link
Author

Adding it to gems: works. Great job with the plugin!

@ashmaroli
Copy link
Owner

Thanks 😃

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