Skip to content

Commit

Permalink
Only build actual translated files and link them accordingly
Browse files Browse the repository at this point in the history
In case of index.md, no languages are specified so all languages are linked, while /guide only links the three languages we have translations for. Removed file count/from 250 to 99 this way. Improve our SEO indexing
  • Loading branch information
shushugah committed Dec 20, 2020
1 parent 155a77f commit d151244
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ gem 'pry'
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.11"
gem "jekyll-multiple-languages-plugin"
gem "jekyll-multiple-languages-plugin", github: "kurtsson/jekyll-multiple-languages-plugin", ref: "refs/pull/178/head"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
12 changes: 9 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/kurtsson/jekyll-multiple-languages-plugin.git
revision: 6290d8c0db1ad62c47a1339465e88a9c3bce67df
ref: refs/pull/178/head
specs:
jekyll-multiple-languages-plugin (1.7.0)
jekyll (>= 2.0, < 5.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -43,8 +51,6 @@ GEM
terminal-table (~> 1.8)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-multiple-languages-plugin (1.7.0)
jekyll (>= 2.0, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
Expand Down Expand Up @@ -95,7 +101,7 @@ DEPENDENCIES
html-proofer
jekyll (= 4.1.1)
jekyll-feed (~> 0.11)
jekyll-multiple-languages-plugin
jekyll-multiple-languages-plugin!
pry

RUBY VERSION
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Note, only the default [en.yml](_i18n/en.yml) must contain the names of each lan

![Screen Shot 2019-07-21 at 14 48 46](https://user-images.githubusercontent.com/7111514/61591397-cb0cd180-abc6-11e9-9876-1577d5c8b4bd.png)

### Versioning
Each translation file, should have same version as other languages. Sometimes that is not possible, and having different versions, helps document the disparities. For example, a new city is added, but no translation is provided in Russian yet.
To include only certain languages, specify the exact language keys you want inside the page front matter. For example `languages: ["en", 'ja']`

### Supported Pages
* Landing Page [index.md](index.md)
Expand Down
8 changes: 8 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ jekyll_get_json:

exclude:
- .jekyll-cache/
# also update index.md
languages: ["en", "es", "fr", "it", "pt", "ru"]
defaults:
- scope:
path: ""
values:
# unless languages: ["bl" "ah"] is included, english is only/default frontmatter language
languages: ["en"]

exclude_from_localizations: ["assets"]
links:
- url: /chapters
Expand Down
5 changes: 4 additions & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ <h1 class="title">
<svg class="marg-r-1" width="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path class="primarySvgFill" d="M16 2a14 14 0 100 28 14 14 0 000-28zm0 2c.3 0 .7.2 1.2.7.5.5 1 1.4 1.4 2.5.4 1 .8 2.3 1 3.8h-7.2a20 20 0 011-3.8c.4-1.1 1-2 1.4-2.5.5-.5.9-.7 1.2-.7zm-3.5.5l-1 2c-.5 1.3-.9 2.8-1.1 4.5H5c1.4-3 4-5.5 7.4-6.5zm7 0c3.3 1 6 3.4 7.4 6.5h-5.3a22.3 22.3 0 00-2-6.5zM4.4 13H10a34.4 34.4 0 000 6H4.4a12 12 0 010-6zm7.8 0h7.6a31.4 31.4 0 010 6h-7.6a31.5 31.5 0 010-6zm9.7 0h5.7a12 12 0 010 6H22a34.4 34.4 0 000-6zM5 21h5.3a22.3 22.3 0 002 6.5A12 12 0 015.2 21zm7.3 0h7.2a20 20 0 01-1 3.8c-.4 1.1-1 2-1.4 2.5-.5.5-.9.7-1.2.7-.3 0-.7-.2-1.2-.7-.5-.5-1-1.4-1.4-2.5a20 20 0 01-1-3.8zm9.2 0H27a12 12 0 01-7.4 6.5l1-2c.5-1.3.9-2.8 1.1-4.5z"/></svg>
{{ site.lang }}
</button>
{% if page.namespace %}
<ul id="langNav" class="navOverlay abs hide list-style-none">
{% for lang in site.languages %}
{% assign languages = page.languages | default: site.languages %}
{% for lang in languages %}
<li>
{% if site.lang == lang %}
<div class="p-2 bg-black">
Expand All @@ -39,6 +41,7 @@ <h1 class="title">
</li>
{% endfor %}
</ul>
{% endif %}
</div>

<div class="flex flex-row ai-ctr rel">
Expand Down
3 changes: 2 additions & 1 deletion chapter_local/brasil.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: page
title: TWC Brasil
permalink: /brasil/
languages: ["pt"]
---
<style>h1, .main-wrapper h2, h3 {text-align: left; font-weight: bold;}</style>
# Tech Workers Coalition Brasil
Expand All @@ -14,4 +15,4 @@ permalink: /brasil/
- Estamos no Slack da TWC, no canal #local-brasil; a maior parte das nossas discussões online, por enquanto, acontecem lá.

## Código de Conduta
- Todas as reuniões e comunicação interna e externa deve aderir ao [Código de Conduta da TWC](https://techworkerscoalition.org/community-guide/). A privacidade e segurança de cada pessoa é importante para nós. Compartilhar a identidade dos membros e ou tirar/partilhar fotos são estritamente proibidos, a menos que seja dado consentimento expresso.
- Todas as reuniões e comunicação interna e externa deve aderir ao [Código de Conduta da TWC]({% translate_link guide pt %}). A privacidade e segurança de cada pessoa é importante para nós. Compartilhar a identidade dos membros e ou tirar/partilhar fotos são estritamente proibidos, a menos que seja dado consentimento expresso.
3 changes: 2 additions & 1 deletion guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ layout: page
title: Community Guide
namespace: guide
permalink: /community-guide/
permalink_pt: /guia-da-comunidade
permalink_pt: /guia-da-comunidade/
languages: ["en", "pt", "fr"]
---

{% translate_file guide.md %}
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: default
namespace: home
permalink: /
languages: ["en", "es", "fr", "it", "pt", "ru"]
---

<h1 class="lh-tight marg-b-3">{% t home.title %}</h1>
Expand Down

0 comments on commit d151244

Please sign in to comment.