Skip to content

Commit

Permalink
Site SEO updates (#228)
Browse files Browse the repository at this point in the history
* seo improvements, coordination of details in the config

* improve the seo instructional pages
  • Loading branch information
untra authored Jan 18, 2025
1 parent 4847af4 commit c2053b1
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ When adding new posts and pages, add to the YAML front matter:
```
lang: sv
```
or whatever appropriate [I18n language code](https://developer.chrome.com/webstore/i18n)
or whatever appropriate [I18n language code](https://developer.chrome.com/docs/extensions/reference/api/i18n#locales)
the page should build for. And you're done. Ideally, when designing your site, you should
organize files by their relative urls.

Expand Down
83 changes: 54 additions & 29 deletions site/_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Polyglot
languages: ["en", "es", "de", "fr", "ru", "nl", "he", "ko", "zh-CN", "pt-BR"]
default_lang: "en"
exclude_from_localization: ["javascript", "images", "css", "public", "sitemap"]
parallel_localization: false
url: https://polyglot.untra.io

# Where things are
source: .
destination: ./_site
Expand All @@ -24,18 +31,6 @@ author:
# google analytics
ga_tag: G-HWC3D32MT8

# data
hello:
en: Hello!
es: ¡hola!
fr: Bonjour!
de: Hallo!
ru: Привет!
nl: Hallo!
he: "שלום!"
ko: 안녕하세요!
zh-CN: 你好!
pt-BR: Olá!

plugins: [jekyll-polyglot, jekyll-paginate, jekyll-redirect-from]
# Permalinks
Expand All @@ -46,19 +41,54 @@ exclude: ['LICENSE.md', 'README.md', 'publi.sh', 'Gemfile.lock', 'Gemfile']
# Setup
title: Polyglot
tagline: 'Straightforward I18n for Jekyll Blogs'
description:
zh-CN: 一款为 <a href="http://jekyllrb.com" target="_blank">Jekyll</a> 提供 i18n 多语言功能的插件,方便快捷,适用于各类大小博客。<a href="https://github.com/untra" target="_blank">@untra</a> 出品。
ko: <a href="https://github.com/untra" target="_blank">@untra</a>가 만든, 크고 작은 블로그 모두가 빠르고 직관적인 다국어 지원을 가능케 하는 i18n 지원 <a href="http://jekyllrb.com" target="_blank">Jekyll</a> 플러그인.
he: תוסף תמיכה ב-i18n עבור <a href="http://jekyllrb.com" target="_blank">Jekyll</a> שהופך את התמיכה מרובת שפות למהירה ואינטואיטיבית, עבור בלוגים גדולים וקטנים. תוצרת <a href="https://github.com/untra" target="_blank">@untra</a>.
nl: Een plug-in voor internationlisering van <a href="http://jekyllrb.com" target="_blank">Jekyll</a> die meertalige ondersteuning snel en intuïtief maakt, voor blogs groot en klein. Gemaakt door <a href="https://github.com/untra" target="_blank">@untra</a>.
ru: Плагин поддержки i18n для <a href="http://jekyllrb.com" target="_blank">Jekyll</a> что делает поддержку нескольких языков быстрой и интуитивно понятной, для больших и маленьких блогов. Сделано в <a href="https://github.com/untra" target="_blank">@untra</a>.
de: Ein sprachunterstützung plugin für <a href="http://jekyllrb.com" target="_blank">Jekyll</a>, die Unterstützung der Internationalisierung schnell und intuitiv macht, für Blogs groß und klein. Hergestellt von <a href="https://github.com/untra" target="_blank">@untra</a>.
es: Un plugin soporte de i18n para <a href="http://jekyllrb.com" target="_blank">Jekyll</a> que hace soporte de internacionalización rápida e intuitiva, para los blogs grandes y pequeños. Hecho por <a href="https://github.com/untra" target="_blank">@untra</a>.
fr: Un plugin de support de i18n pour <a href="http://jekyllrb.com" target="_blank">Jekyll</a> qui fait support de l'internationalisation rapide et intuitive, pour tous les blogs. Réalisé par <a href="https://github.com/untra" target="_blank">@untra</a>.
en: A i18n support plugin for <a href="http://jekyllrb.com" target="_blank">Jekyll</a> that makes multi-language support fast and intuitive, for blogs big and small. Made by <a href="https://github.com/untra" target="_blank">@untra</a>.
pt-BR: Um plugin de suporte i18n para <a href="http://jekyllrb.com" target="_blank">Jekyll</a> que torna o suporte a vários idiomas rápido e intuitivo, para blogs grandes e pequenos. Feito por <a href="https://github.com/untra" target="_blank">@untra</a>.

url: https://polyglot.untra.io
# data
sidebar:
hello:
en: Hello!
es: ¡hola!
fr: Bonjour!
de: Hallo!
ru: Привет!
nl: Hallo!
he: "שלום!"
ko: 안녕하세요!
zh-CN: 你好!
pt-BR: Olá!
description:
zh-CN: 一款为 <a href="http://jekyllrb.com" target="_blank">Jekyll</a> 提供 i18n 多语言功能的插件,方便快捷,适用于各类大小博客。<a href="https://github.com/untra" target="_blank">@untra</a> 出品。
ko: <a href="https://github.com/untra" target="_blank">@untra</a>가 만든, 크고 작은 블로그 모두가 빠르고 직관적인 다국어 지원을 가능케 하는 i18n 지원 <a href="http://jekyllrb.com" target="_blank">Jekyll</a> 플러그인.
he: תוסף תמיכה ב-i18n עבור <a href="http://jekyllrb.com" target="_blank">Jekyll</a> שהופך את התמיכה מרובת שפות למהירה ואינטואיטיבית, עבור בלוגים גדולים וקטנים. תוצרת <a href="https://github.com/untra" target="_blank">@untra</a>.
nl: Een plug-in voor internationlisering van <a href="http://jekyllrb.com" target="_blank">Jekyll</a> die meertalige ondersteuning snel en intuïtief maakt, voor blogs groot en klein. Gemaakt door <a href="https://github.com/untra" target="_blank">@untra</a>.
ru: Плагин поддержки i18n для <a href="http://jekyllrb.com" target="_blank">Jekyll</a> что делает поддержку нескольких языков быстрой и интуитивно понятной, для больших и маленьких блогов. Сделано в <a href="https://github.com/untra" target="_blank">@untra</a>.
de: Ein sprachunterstützung plugin für <a href="http://jekyllrb.com" target="_blank">Jekyll</a>, die Unterstützung der Internationalisierung schnell und intuitiv macht, für Blogs groß und klein. Hergestellt von <a href="https://github.com/untra" target="_blank">@untra</a>.
es: Un plugin soporte de i18n para <a href="http://jekyllrb.com" target="_blank">Jekyll</a> que hace soporte de internacionalización rápida e intuitiva, para los blogs grandes y pequeños. Hecho por <a href="https://github.com/untra" target="_blank">@untra</a>.
fr: Un plugin de support de i18n pour <a href="http://jekyllrb.com" target="_blank">Jekyll</a> qui fait support de l'internationalisation rapide et intuitive, pour tous les blogs. Réalisé par <a href="https://github.com/untra" target="_blank">@untra</a>.
en: A i18n support plugin for <a href="http://jekyllrb.com" target="_blank">Jekyll</a> that makes multi-language support fast and intuitive, for blogs big and small. Made by <a href="https://github.com/untra" target="_blank">@untra</a>.
pt-BR: Um plugin de suporte i18n para <a href="http://jekyllrb.com" target="_blank">Jekyll</a> que torna o suporte a vários idiomas rápido e intuitivo, para blogs grandes e pequenos. Feito por <a href="https://github.com/untra" target="_blank">@untra</a>.

keywords:
en: multilingual, i18n, jekyll, polyglot, fast, intuitive, untra, github, pages, blog, plugin, ruby, gem, internationalization, localization, translation, language, support, multi-language, multi-lingual
ko: 다국어, i18n, 제킬, 다국어, 빠른, 직관적인, untra, 깃허브, 페이지, 블로그, 플러그인, 루비, 젬, 국제화, 현지화, 번역, 언어, 지원, 다국어, 다국어
he: רב-לשוני, i18n, ג'קיל, רב-לשוני, מהיר, אינטואיטיבי, untra, גיטהאב, דפים, בלוג, תוסף, רובי, ג'ם, בינלאומיות, לוקליזציה, תרגום, שפה, תמיכה, רב-לשוני, רב-לשוני
nl: meertalig, i18n, jekyll, meertalig, snel, intuïtief, untra, github, pagina's, blog, plugin, ruby, gem, internationalisering, lokalisatie, vertaling, taal, ondersteuning, meertalig, meertalig
ru: многоязычный, i18n, джекилл, полиглот, быстрый, интуитивный, untra, гитхаб, страницы, блог, плагин, рубин, гем, интернационализация, локализация, перевод, язык, поддержка, многоязычный, многоязычный
de: mehrsprachig, i18n, jekyll, polyglot, schnell, intuitiv, untra, github, seiten, blog, plugin, ruby, gem, internationalisierung, lokalisierung, übersetzung, sprache, unterstützung, mehrsprachig, mehrsprachig
es: multilingüe, i18n, jekyll, políglota, rápido, intuitivo, untra, github, páginas, blog, plugin, ruby, gem, internacionalización, localización, traducción, idioma, soporte, multilingüe, multilingüe
fr: multilingue, i18n, jekyll, polyglotte, rapide, intuitif, untra, github, pages, blog, plugin, ruby, gem, internationalisation, localisation, traduction, langue, support, multilingue, multilingue
pt-BR: multilíngue, i18n, jekyll, políglota, rápido, intuitivo, untra, github, páginas, blog, plugin, ruby, gem, internacionalização, localização, tradução, idioma, suporte, multilíngue, multilíngue
zh-CN: 多语言, i18n, 杰基尔, 多语种, 快速, 直观, untra, 깃허브, 页面, 博客, 插件, 卢比, gem, 国际化, 本地化, 翻译, 语言, 支持, 多语言, 多语言
description:
zh-CN: 一款为 Jekyll 提供 i18n 多语言功能的插件,方便快捷,适用于各类大小博客
ko: 크고 작은 블로그 모두가 빠르고 직관적인 다국어 지원을 가능케 하는 i18n 지원 Jekyll 플러그인.
he: תוסף תמיכה ב-i18n עבור Jekyll שהופך את התמיכה מרובת שפות למהירה ואינטואיטיבית, עבור בלוגים גדולים וקטנים. תוצרת.
nl: Een plug-in voor internationlisering van Jekyll die meertalige ondersteuning snel en intuïtief maakt, voor blogs groot en klein.
ru: Плагин поддержки i18n для Jekyll что делает поддержку нескольких языков быстрой и интуитивно понятной, для больших и маленьких блогов.
de: Ein sprachunterstützung plugin für Jekyll, die Unterstützung der Internationalisierung schnell und intuitiv macht, für Blogs groß und klein.
es: Un plugin soporte de i18n para Jekyll que hace soporte de internacionalización rápida e intuitiva, para los blogs grandes y pequeños.
fr: Un plugin de support de i18n pour Jekyll qui fait support de l'internationalisation rapide et intuitive, pour tous les blogs.
en: A i18n support plugin for Jekyll that makes multi-language support fast and intuitive, for blogs big and small.
pt-BR: Um plugin de suporte i18n para Jekyll que torna o suporte a vários idiomas rápido e intuitivo, para blogs grandes e pequenos.

paginate: 5
# Custom vars
Expand All @@ -69,10 +99,5 @@ langsep: "•"
github:
repo: https://github.com/untra/polyglot

#Polyglot
languages: ["en", "es", "de", "fr", "ru", "nl", "he", "ko", "zh-CN", "pt-BR"]
default_lang: "en"
exclude_from_localization: ["javascript", "images", "css", "public", "sitemap"]
parallel_localization: false
whitelist:
- jekyll-redirect-from
6 changes: 5 additions & 1 deletion site/_includes/head.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<head>
{% assign lang = site.active_lang %}
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="{{ page.title }} &middot; {{ site.title }}">
<meta name="description" content="{{ page.description | default: site.description[site.active_lang] }}">
<meta name="keywords" content="{{ page.keywords | default: site.keywords[site.active_lang] }}">
{% I18n_Headers %}
<title>
{% if page.title == "Home" %}
Expand Down
4 changes: 2 additions & 2 deletions site/_includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<div class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<p class="speech">{{ site.hello[site.active_lang]}}</p>
<p class="speech">{{ site.sidebar.hello[site.active_lang] }}</p>
</br>
<h1>
<a href="{{ site.baseurl }}">
{{ site.title }}
</a>
</h1>
<p class="lead">{{ site.description[lang] }}</p>
<p class="lead">{{ site.sidebar.description[site.active_lang] }}</p>
</div>

<nav class="sidebar-nav">
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink-he.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: קישור קבוע ממש ארוך
permalink: a-really-long-hebrew/permalink/
lang: he
page_id: complex-permalink
description: דף זה מדגים כיצד Jekyll Polyglot יכול ליצור ולתחזק קישורים קבועים מותאמים אישית תוך שמירה על מבנה האתר.
---

הקישור הקבוע הזה באמת ארוך ומורכב
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Eine wirklich lange permalink
permalink: eine-wirklich-lange/permalink/
lang: de
page_id: complex-permalink
description: diese Seite zeigt, wie jekyll polyglot benutzerdefinierte permanente Links erstellen und verwalten kann, während die Site-Struktur beibehalten wird.
---

Permalink ist wirklich lang und komplex.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: A really long permalink
permalink: a-really-long/permalink/
lang: en
page_id: complex-permalink
description: this page demonstrates how jekyll polyglot can create and maintain customized permalinks while retaining site structure.
---

This permalink is really long and complex.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Un muy largo permalink
permalink: una-muy-larga/permalink/
lang: es
page_id: complex-permalink
description: esta página demuestra cómo jekyll polyglot puede crear y mantener enlaces permanentes personalizados mientras se mantiene la estructura del sitio.
---

Este enlace permanente es muy largo y complejo.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Un très long permalink
permalink: un-tres-long/permalink/
lang: fr
page_id: complex-permalink
description: cette page démontre comment jekyll polyglot peut créer et maintenir des liens permanents personnalisés tout en conservant la structure du site.
---

Ce permalien est vraiment long et complexe.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: 매우 긴 퍼마링크
permalink: a-really-long-korean/permalink/
lang: ko
page_id: complex-permalink
description: 이 페이지는 Jekyll Polyglot가 사이트 구조를 유지하면서 사용자 정의된 영구 링크를 만들고 유지 관리하는 방법
---

이 퍼마링크는 매우 길고 복잡합니다
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Een werkelijk lange permalink
permalink: een-hele-lange/permalink/
lang: nl
page_id: complex-permalink
description: deze pagina demonstreert hoe jekyll polyglot aangepaste permanente koppelingen kan maken en onderhouden terwijl de site structuur behouden blijft.
---

Deze permalink is werkelijk lang en complex.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Um permalink bem longo
permalink: um-longo/permalink/
lang: pt-BR
page_id: complex-permalink
description: esta página demonstra como o jekyll polyglot pode criar e manter links permanentes personalizados enquanto mantém a estrutura do site.
---

Esse permalink é realmente longo e complexo.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: A really long permalink
permalink: a-really-long-russian/permalink/
lang: ru
page_id: complex-permalink
description: эта страница демонстрирует, как jekyll polyglot может создавать и поддерживать настраиваемые постоянные ссылки при сохранении структуры сайта.
---

Действительно длинная постоянная ссылка.
Expand Down
1 change: 1 addition & 0 deletions site/complex-permalink.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: 一条超长的永久链接
permalink: yi-tiao-chao-chang-de-yong-jiu-lian-jie/permalink/
lang: zh-CN
page_id: complex-permalink
description: 本页面演示了如何使用 Jekyll Polyglot 创建和维护自定义的永久链接,同时保留站点结构。
---

这个永久链接真的超长超复杂
Expand Down
21 changes: 11 additions & 10 deletions site/seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
title: SEO Recipes
permalink: seo/
lang: en
description: These additions can help improve the SEO of your multi-language jekyll blog when using Polyglot.
---
# Recipes for Search Engine Optimization using Polyglot

Expand Down Expand Up @@ -43,19 +44,19 @@ to your site, achieving SEO with google multi-language searches. Add the followi
You can get all of the above with a single tag added to your `head.html`:
{% highlight html %}
{% raw %}
{% I18n_Headers https://untra.github.com/polyglot %}
{% endraw %}
{% endhighlight %}

Just add the permanent url for your website and all of the above SEO will be added to each page in your website.
In version >= 1.2.4, you can leave it empty, just calling
{% highlight html %}
{% raw %}
{% I18n_Headers %}
{% endraw %}
{% endhighlight %}
and it will default to your `site.url`

With this SEO, each page click for one sites language will count towards the net clicks of all languages on the website.

## Other SEO best practices for polyglot

With this SEO, each page click for one sites language will count towards the net clicks of all languages on the website.
* always be sure to specify `<meta>` tags for `keywords` and `description` of pages. Search Engines will use these tags to better index pages; for multi-language websites you should supply different values for each sub-language your website supports:

{% highlight html %}
{% raw %}
<meta name="description" content="{{ page.description | default: site.description[site.active_lang] }}">
<meta name="keywords" content="{{ page.keywords | default: site.keywords[site.active_lang] }}">
{% endraw %}
{% endhighlight %}
62 changes: 62 additions & 0 deletions site/seo.pt-BR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
layout: page
title: SEO Recipes
permalink: seo/
lang: en
description: These additions can help improve the SEO of your multi-language jekyll blog when using Polyglot.
---
# Receitas para Otimização de Mecanismos de Busca usando Polyglot

Se você instalou a gema `jekyll-polyglot`, essas adições ao cabeçalho do seu site podem facilmente fornecer ao seu blog jekyll bônus de SEO fornecidos pelo Google.

## Declaração de Idioma HTML

Per [W3C Internationalization Best Practices](http://www.w3.org/International/geo/html-tech/tech-lang.html#ri20060630.133615821)
Você pode definir o idioma padrão de cada página com uma meta tag. Basta adicionar o seguinte ao seu cabeçalho:

{% highlight html %}{% raw %}
<meta http-equiv="Content-Language" content="{{site.active_lang}}">
{% endraw %}
{% endhighlight %}

## Multi-language SEO usando hreflang alternate tags

Você pode facilmente adicionar [hreflang alternate tags](https://support.google.com/webmasters/answer/189077?hl=pt-BR)
ao seu site, obtendo SEO com pesquisas multilíngues do Google. Adicione o seguinte ao seu head:
{% highlight html %}
{% raw %}
<link rel="alternate"
hreflang="{{site.default_lang}}"
href="http://yoursite.com{{page.permalink}}" />
{% for lang in site.languages %}
{% if lang == site.default_lang %}
{% continue %}
{% endif %}
<link rel="alternate"
hreflang="{{lang}}"
href="http://yoursite.com/{{lang}}{{page.permalink}}" />
{% endfor %}
{% endraw %}
{% endhighlight %}

## Todas as anteriores

Você pode obter tudo isso acima com uma única tag adicionada ao seu `head.html`:
{% highlight html %}
{% raw %}
{% I18n_Headers %}
{% endraw %}
{% endhighlight %}

Com esse SEO, cada clique em uma página de um idioma do site contará para o total de cliques de todos os idiomas do site.

## Outras práticas recomendadas de SEO para polyglot

* sempre certifique-se de especificar as tags `<meta>` para `keywords` e `description` das páginas. Os mecanismos de pesquisa usarão essas tags para indexar melhor as páginas; para sites multilíngues, você deve fornecer valores diferentes para cada subidioma que seu site da web oferece suporte:

{% highlight html %}
{% raw %}
<meta name="description" content="{{ page.description | default: site.description[site.active_lang] }}">
<meta name="keywords" content="{{ page.keywords | default: site.keywords[site.active_lang] }}">
{% endraw %}
{% endhighlight %}
Loading

0 comments on commit c2053b1

Please sign in to comment.