forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: George Araujo <[email protected]>
- Loading branch information
1 parent
8f1528a
commit bee6a86
Showing
152 changed files
with
1,266 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Upgrading | ||
|
||
As of Jan 15, 2024, the [jekyll-multiple-languages-plugin](https://github.com/kurtsson/jekyll-multiple-languages-plugin) repository has been archived by its owner and is now read-only, meaning it will not receive further updates. As discussed in [#17](https://github.com/george-gca/multi-language-al-folio/issues/17), one possible solution was to replace the plugin with [jekyll-polyglot](https://github.com/untra/polyglot). This change has been implemented as of version 1.11.0 of this theme. | ||
|
||
## Project changes | ||
|
||
A few changes were made necessary by the switch to `polyglot`. More specifically: | ||
|
||
- all usages of `site.lang` were replaced by `site.active_lang`, since this is how the `polyglot` plugin stores the active language | ||
- moved `_i18n/` contents to their respective `LANG/` directories inside the `_news/`, `_pages/`, `_posts/`, and `_projects/` directories. E.g.: `_i18n/en-us/_pages/about.md` was moved to `_pages/en-us/about.md` | ||
- a few modifications were made to the `_config.yml` file related to the `polyglot` plugin | ||
- contents of the files `_i18n/LANG.yml` were moved to `_data/LANG/strings.yml`. Note that not all variables were moved. The rest of the variables were used directly in the pages contents | ||
|
||
### Directory changes | ||
|
||
[Previously](https://github.com/george-gca/multi-language-al-folio/tree/8f1528a4816aaf16e916791ae0f8cddbecf2416a) some pages were composed by a main page, like the [\_pages/about.md](https://github.com/george-gca/multi-language-al-folio/blob/8f1528a4816aaf16e916791ae0f8cddbecf2416a/_pages/about.md) page, and a translated subpage, like the [\_i18n/en-us/\_pages/about.md](https://github.com/george-gca/multi-language-al-folio/blob/8f1528a4816aaf16e916791ae0f8cddbecf2416a/_i18n/en-us/_pages/about.md). This structure was changed to a single page with all the content in the same file, one file for each language in [\_pages/LANG/](https://github.com/george-gca/multi-language-al-folio/tree/polyglot/_pages/en-us). This change was made to simplify the structure of the theme and to make it easier to maintain. It also allows to have completely different pages for different languages if needed. | ||
|
||
### Translated strings | ||
|
||
Another change was the usage of translated strings in the pages. Before, the translated strings were used in the pages by using the `t` filter, like `{% t titles.about %}`, and these strings were defined inside [\_i18n/LANG.yml](https://github.com/george-gca/multi-language-al-folio/blob/8f1528a4816aaf16e916791ae0f8cddbecf2416a/_i18n/en-us.yml). Now, when possible, the translated strings are used directly in the pages for that language. When a string is used at the layout level, like in the [\_layouts/about.liquid](_layouts/about.liquid) file, we now have to call for the translated string inside [\_data/LANG/strings.yml](https://github.com/george-gca/multi-language-al-folio/blob/polyglot/_data/en-us/strings.yml). What previously was: | ||
|
||
```liquid | ||
{% t main.contact_note %} | ||
``` | ||
|
||
now is: | ||
|
||
```liquid | ||
{{ site.data[site.active_lang].strings.contact_note }} | ||
``` | ||
|
||
### Other information | ||
|
||
Due to the usage of the `polyglot` plugin, a lot of the previous workarounds were made unnecessary. For example, the `t` filter was used to translate the `page.title` and `page.description` variables in a lot of different files. Now, the values of these variables can be directly used. The same applies to some solutions regarding page redirects or assets usage. For example, in the file [\_layouts/archive-category.liquid](_layouts/archive-category.liquid), we had this piece of code: | ||
|
||
```liquid | ||
{% assign is_asset = post.redirect | startswith: '/assets/' %} | ||
{% if is_asset %} | ||
<a class="post-link" href="{{ post.redirect | prepend: site.baseurl_root }}">{{ post.title }}</a> | ||
{% else %} | ||
<a class="post-link" href="{{ post.redirect | prepend: site.baseurl }}">{{ post.title }}</a> | ||
{% endif %} | ||
``` | ||
|
||
Which was responsible to assess if the `post.redirect` was an asset or a page and to build the correct link considering the current language. Now, we can simply use: | ||
|
||
```liquid | ||
<a class="post-link" href="{{ post.redirect | relative_url }}">{{ post.title }}</a> | ||
``` | ||
|
||
since the `polyglot` plugin takes care of the language prefix in the URLs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ middle_name: R. | |
last_name: Name | ||
email: [email protected] | ||
keywords: jekyll, jekyll-theme, academic-website, portfolio-website # add your own keywords or leave empty | ||
|
||
lang: en-us # the main language of your site (for example: en, fr, cn, ru, etc.) | ||
icon: ⚛️ # the emoji used as the favicon (alternatively, provide image name in /assets/img/) | ||
|
||
url: https://george-gca.github.io # the base hostname & protocol for your site | ||
|
@@ -115,7 +113,6 @@ bing_site_verification: # out your bing-site-verification ID (Bing Webmaster) | |
# Blog | ||
# ----------------------------------------------------------------------------- | ||
|
||
blog_nav_title: true | ||
permalink: /blog/:year/:title/ | ||
|
||
# Pagination | ||
|
@@ -226,8 +223,8 @@ plugins: | |
- jekyll-jupyter-notebook | ||
- jekyll-link-attributes | ||
- jekyll-minifier | ||
- jekyll-multiple-languages-plugin | ||
- jekyll-paginate-v2 | ||
- jekyll-polyglot | ||
- jekyll/scholar | ||
- jekyll-sitemap | ||
- jekyll-toc | ||
|
@@ -242,14 +239,9 @@ defaults: | |
sitemap: false | ||
|
||
sass: | ||
sourcemap: never | ||
style: compressed | ||
|
||
# multi language settings | ||
default_locale_in_subfolder: false | ||
exclude_from_localizations: ["assets"] | ||
languages: ["en-us", "pt-br"] | ||
country_flag: false # set true for allowing flag symbol in language toggle | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Jekyll Minifier | ||
# ----------------------------------------------------------------------------- | ||
|
@@ -334,6 +326,17 @@ external_links: | |
target: _blank | ||
exclude: | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Jekyll Polyglot | ||
# ----------------------------------------------------------------------------- | ||
|
||
languages: ["en-us", "pt-br"] | ||
default_lang: "en-us" | ||
exclude_from_localization: ["assets"] | ||
lang_from_path: true | ||
country_flag: false # set true for allowing flag symbol in language toggle | ||
# parallel_localization: true | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Responsive WebP Images | ||
# ----------------------------------------------------------------------------- | ||
|
@@ -377,7 +380,6 @@ enable_masonry: true # enables automatic project cards arrangement | |
enable_math: true # enables math typesetting (uses MathJax) | ||
enable_tooltips: false # enables automatic tooltip links generated for each section titles on pages and posts | ||
enable_darkmode: true # enables switching between light/dark modes | ||
enable_localization: true # enables switching between languages | ||
enable_navbar_social: false # enables displaying social links in the navbar on the about page | ||
enable_project_categories: true # enables categorization of projects into multiple categories | ||
enable_medium_zoom: true # enables image zoom feature (as on medium.com) | ||
|
@@ -459,7 +461,7 @@ vega-lite: | |
# ----------------------------------------------------------------------------- | ||
|
||
jekyll_get_json: | ||
- data: resume_en | ||
- data: resume_en-us | ||
json: assets/json/resume_en-us.json # it can also be an url | ||
- data: resume_pt-br | ||
json: assets/json/resume_pt-br.json # it can also be an url | ||
|
Oops, something went wrong.