-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
Gemfile
Outdated
@@ -9,6 +9,7 @@ source "https://rubygems.org" | |||
# This will help ensure the proper Jekyll version is running. | |||
# Happy Jekylling! | |||
gem "jekyll", "~> 3.7.2" | |||
gem 'jekyll-multiple-languages-plugin' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can specify the version, no?
And we can use also the "
as in the previous line.
gem "jekyll-multiple-languages-plugin", "~> 1.6"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
d9c72b6
to
0cc8912
Compare
|
||
<div class='project'> | ||
<div class='logo'> | ||
<img src='{{ "/assets/img/projects/katuma.png" | prepend:site.baseurl }}' width='140' height='140' /> | ||
</div> | ||
<div class='description'> | ||
{{ page.katuma_description | markdownify }} | ||
{% t page.katuma_description %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, markdownify
doesn't work with {% %}
tags so we need to write these translations in HTML instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you markdownify in an assign
variable and then use it? Would that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried and it doesn't. Looks like you can't use filters there either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do a helper in Ruby that use markdownify
. I think Jekyll has helpers a la Rails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I thought about that. Or even open a PR against that plugin to allow for this but I don't think it's a big deal now. We were just markdownifying couple links and a <strong>
.
We can create an issue for it in the future though if things get painful.
Is this Jekill plugin supported by GH Pages? |
That's a good point. It just adds extra build steps but I'm not sure how that relates to GH's build process... I bet not very well... 🙈 |
The build can happen in your machine. It should not be a problem afaik |
We'll need to do #33 first. |
In that case we loose the automated build/deploy on code change, that's the main selling point of GH pages IMHO. This is why I started to investigate how to support Jekyll deploys on our servers: https://github.com/coopdevs/coopdevs-provisioning/blob/master/roles/coopdevs.org/files/post-receive It works, but we still don't use it. |
What about Netlify? It's more flexible than Gh pages |
Anyway this it's juat build in local machine and push to gh-pages branch. Not hard to implement. Does people change content on this side from GitHub UI? If all the changes are done by a developer I would stick with Gh pages |
This is why I stopped investigating our solution, I wanted to try Netlify.... but, you know... time...
We have/want more people than developers to be able to contribute to our projects, that's why I would keep the build and deploy automation in place. |
This plugin adds a folder for each language defined in config. As a result we moved all posts to each language folder so that we keep the current behavior of mixing languages. Now, to add new pages we'll have to add the template plus its translations. That is, about.html with a call to `translate_file`, _i18n/ca/about.md and _i18n/es/about.md. Then, all translation keys live in either _i18n/ca.yml and _i18n/es.yml. See more details in: https://github.com/Anthony-Gaudino/jekyll-multiple-languages-plugin
`jekyll-multiple-languages-plugin` is better designed than our naive redirect to /ca and allows us to fix bugs we already have. Unfortunately tag markup ({% %}) doesn't work with filters so `| markdownify` can't be used anymore. We use translation keys instead.
0cc8912
to
d32ba65
Compare
Up & Running 🎉 ! |
Description
I refactored the site to use jekyll-multiple-languages-plugin. This plugin adds a folder for each language defined in config. As a result we moved all posts to each language folder so that we keep the current behavior of mixing languages.
Now, to add new pages we'll have to add the template plus its translations. That is,
about.html
with a call totranslate_file
, plus the files_i18n/ca/about.md
and_i18n/es/about.md
.Then, all translation keys live in either
_i18n/ca.yml
and_i18n/es.yml
.Source: kurtsson/jekyll-multiple-languages-plugin#125 (comment)
After seeing people using home-made solutions and other plugins I can tell this is one seems the best to me. Even, if we need to, we could mess with the code. It's not a big deal.
See more details in: Anthony-Gaudino/jekyll-multiple-languages-plugin
Fixes
I also took the chance to fix
Seguir leyendo
. We were displaying it in both Catalan and Spanish. Now that's translated.