Skip to content

Commit dcc9fe1

Browse files
committed
Update how-to-support-multi-language-on-jekyll-blog-with-polyglot.md
1 parent d1eea55 commit dcc9fe1

8 files changed

+51
-30
lines changed

_posts/de/2024-11-18-how-to-support-multi-language-on-jekyll-blog-with-polyglot.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ tags:
1111
---
1212
## Einleitung
1313
Vor etwa 4 Monaten, Anfang Juli 2024, habe ich das [Polyglot](https://github.com/untra/polyglot)-Plugin implementiert, um mehrsprachige Unterstützung für diesen Jekyll-basierten Blog hinzuzufügen, der über Github Pages gehostet wird.
14-
In diesem Beitrag teile ich die Bugs, die während der Implementierung des Polyglot-Plugins auftraten, deren Lösungsprozess und wie man HTML-Header und sitemap.xml unter Berücksichtigung von SEO erstellt.
14+
In diesem Beitrag teile ich die Bugs, die während der Anwendung des Polyglot-Plugins auf das Chirpy-Theme auftraten, deren Lösungsprozesse, sowie Methoden zum Schreiben von HTML-Headern und sitemap.xml unter Berücksichtigung der SEO.
1515

1616
## Anforderungen
17-
- [x] Die gebauten Ergebnisse (Webseiten) sollten in sprachspezifischen Pfaden (z.B. `/posts/ko/`{: .filepath}, `/posts/ja/`{: .filepath}) bereitgestellt werden.
18-
- [x] Um den zusätzlichen Zeit- und Arbeitsaufwand für die mehrsprachige Unterstützung zu minimieren, sollte die Sprache beim Bauen automatisch anhand des lokalen Pfads der originalen Markdown-Datei (z.B. `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}) erkannt werden, ohne dass 'lang' und 'permalink' Tags im YAML-Frontmatter der Markdown-Datei manuell angegeben werden müssen.
19-
- [x] Der Header-Bereich jeder Seite der Website sollte angemessene Content-Language Meta-Tags und hreflang Alternate-Tags enthalten, um die SEO-Richtlinien für die Google-Mehrsprachensuche zu erfüllen.
20-
- [x] Die `sitemap.xml` sollte Links zu allen mehrsprachigen Seiten der Website ohne Auslassungen bereitstellen, und die `sitemap.xml` selbst sollte nur einmal im Root-Verzeichnis existieren, ohne Duplikate.
21-
- [ ] Alle Funktionen, die vom [Chirpy-Theme](https://github.com/cotes2020/jekyll-theme-chirpy) bereitgestellt werden, sollten auf jeder Sprachseite normal funktionieren. Falls nicht, müssen sie entsprechend angepasst werden.
17+
- [x] Die gebauten Ergebnisse (Webseiten) sollten unter sprachspezifischen Pfaden (z.B. `/posts/ko/`{: .filepath}, `/posts/ja/`{: .filepath}) bereitgestellt werden können.
18+
- [x] Um den zusätzlichen Zeit- und Arbeitsaufwand für die mehrsprachige Unterstützung zu minimieren, sollte es möglich sein, die Sprache automatisch anhand des lokalen Pfads (z.B. `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}) zu erkennen, ohne dass 'lang' und 'permalink' Tags im YAML-Frontmatter der originalen Markdown-Dateien manuell spezifiziert werden müssen.
19+
- [x] Der Header-Bereich jeder Seite der Website sollte angemessene Content-Language Meta-Tags und hreflang Alternate-Tags enthalten, um die SEO-Richtlinien für die mehrsprachige Google-Suche zu erfüllen.
20+
- [x] Es sollte möglich sein, Links zu allen Seiten, die jede Sprache unterstützen, ohne Auslassungen in der `sitemap.xml` bereitzustellen, und die `sitemap.xml` selbst sollte nur einmal im Root-Verzeichnis ohne Duplikate existieren.
21+
- [ ] Alle vom [Chirpy-Theme](https://github.com/cotes2020/jekyll-theme-chirpy) bereitgestellten Funktionen sollten auf jeder Sprachseite normal funktionieren, andernfalls sollten sie entsprechend angepasst werden.
22+
- [x] Normale Funktion von Features wie 'Recently Updated', 'Trending Tags' usw.
23+
- [x] Keine falsch positiven (False Positive) Warnungen bei der Überprüfung interner Links während des Build-Prozesses mit GitHub Actions
24+
- [ ] Normale Funktion der Beitragssuche in der oberen rechten Ecke des Blogs
2225

2326
## Anwendung des Polyglot-Plugins
2427
Da Jekyll standardmäßig keine mehrsprachigen Blogs unterstützt, ist ein externes Plugin erforderlich, um einen mehrsprachigen Blog zu implementieren, der die obigen Anforderungen erfüllt. Nach einiger Recherche stellte sich heraus, dass [Polyglot](https://github.com/untra/polyglot) häufig für die Implementierung mehrsprachiger Websites verwendet wird und die meisten der obigen Anforderungen erfüllen kann, daher wurde dieses Plugin ausgewählt.

_posts/en/2024-11-18-how-to-support-multi-language-on-jekyll-blog-with-polyglot.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: How to Support Multiple Languages on a Jekyll Blog with Polyglot
2+
title: How to Support Multiple Languages on Jekyll Blog with Polyglot
33
description: >-
44
Introducing the process of implementing multilingual support by applying the Polyglot plugin to a Jekyll blog based on 'jekyll-theme-chirpy'.
55
categories:
@@ -11,14 +11,17 @@ tags:
1111
---
1212
## Introduction
1313
About 4 months ago, in early July 2024, I added multilingual support to this Jekyll-based blog hosted on Github Pages by applying the [Polyglot](https://github.com/untra/polyglot) plugin.
14-
In this post, I will share the bugs encountered during the process of applying the Polyglot plugin and their solutions, as well as how to write HTML headers and sitemap.xml considering SEO.
14+
In this post, I'll share the bugs encountered while applying the Polyglot plugin to the Chirpy theme, their resolution process, and how to write HTML headers and sitemap.xml considering SEO.
1515

1616
## Requirements
17-
- [x] The build result (web pages) should be provided in language-specific paths (e.g., `/posts/ko/`{: .filepath}, `/posts/ja/`{: .filepath}).
18-
- [x] To minimize the additional time and effort required for multilingual support, the language should be automatically recognized based on the local path (e.g., `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}) where the original markdown file is located during the build process, without having to specify 'lang' and 'permalink' tags in the YAML front matter of each markdown file.
17+
- [x] The built result (web pages) should be provided in language-specific paths (e.g., `/posts/ko/`{: .filepath}, `/posts/ja/`{: .filepath}).
18+
- [x] To minimize the additional time and effort required for multilingual support, the language should be automatically recognized based on the local path (e.g., `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}) where the original markdown file is located during build, without having to specify 'lang' and 'permalink' tags in the YAML front matter of each file.
1919
- [x] The header part of each page on the site should include appropriate Content-Language meta tags and hreflang alternate tags to meet Google's multilingual search SEO guidelines.
2020
- [x] All page links supporting each language on the site should be provided in `sitemap.xml` without omission, and `sitemap.xml` itself should exist only once in the root path without duplication.
2121
- [ ] All functions provided by the [Chirpy theme](https://github.com/cotes2020/jekyll-theme-chirpy) should work normally on each language page, and if not, they should be modified to work properly.
22+
- [x] Normal operation of features such as 'Recently Updated', 'Trending Tags', etc.
23+
- [x] No false positive warnings during internal link error verification in the build process using GitHub Actions
24+
- [ ] Normal operation of the post search function in the upper right corner of the blog
2225

2326
## Applying the Polyglot Plugin
2427
Since Jekyll does not natively support multilingual blogs, an external plugin must be used to implement a multilingual blog that meets the above requirements. After searching, I found that [Polyglot](https://github.com/untra/polyglot) is widely used for multilingual website implementation and can satisfy most of the above requirements, so I adopted this plugin.

_posts/es/2024-11-18-how-to-support-multi-language-on-jekyll-blog-with-polyglot.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Cómo implementar soporte multilingüe en un blog Jekyll con Polyglot
33
description: >-
4-
Se presenta el proceso de implementación de soporte multilingüe utilizando el plugin Polyglot en un blog Jekyll basado en 'jekyll-theme-chirpy'.
4+
Se presenta el proceso de implementación del soporte multilingüe utilizando el plugin Polyglot en un blog Jekyll basado en 'jekyll-theme-chirpy'.
55
categories:
66
- Blogging
77
tags:
@@ -10,15 +10,18 @@ tags:
1010
- RegExp
1111
---
1212
## Introducción
13-
Hace aproximadamente 4 meses, a principios de julio de 2024, implementé el soporte multilingüe en este blog basado en Jekyll y alojado a través de Github Pages aplicando el plugin [Polyglot](https://github.com/untra/polyglot).
14-
En este artículo, compartiré los errores que surgieron durante el proceso de aplicación del plugin Polyglot, cómo los resolví, y cómo escribir el encabezado html y sitemap.xml considerando el SEO.
13+
Hace aproximadamente 4 meses, a principios de julio de 2024, implementé el soporte multilingüe en este blog basado en Jekyll y alojado a través de Github Pages, aplicando el plugin [Polyglot](https://github.com/untra/polyglot).
14+
En este artículo, compartiré los errores que surgieron durante el proceso de aplicación del plugin Polyglot al tema Chirpy, cómo los resolví, y cómo escribir el encabezado html y el sitemap.xml considerando el SEO.
1515

1616
## Requisitos
1717
- [x] Debe ser posible proporcionar el resultado de la compilación (páginas web) separado por rutas de idioma (ej. `/posts/ko/`{: .filepath}, `/posts/ja/`{: .filepath}).
18-
- [x] Para minimizar el tiempo y esfuerzo adicionales requeridos para el soporte multilingüe, debe ser posible reconocer automáticamente el idioma según la ruta local donde se encuentra el archivo (ej. `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}) durante la compilación, sin tener que especificar manualmente las etiquetas 'lang' y 'permalink' en el YAML front matter del archivo markdown original.
18+
- [x] Para minimizar el tiempo y esfuerzo adicionales necesarios para el soporte multilingüe, debe ser posible reconocer automáticamente el idioma según la ruta local donde se encuentra el archivo markdown original (ej. `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}) durante la compilación, sin tener que especificar manualmente las etiquetas 'lang' y 'permalink' en el YAML front matter de cada archivo.
1919
- [x] El encabezado de cada página del sitio debe incluir las etiquetas meta Content-Language y hreflang alternativas apropiadas para cumplir con las pautas de SEO para la búsqueda multilingüe de Google.
20-
- [x] Debe ser posible proporcionar enlaces a todas las páginas que admiten cada idioma en el sitio sin omisiones en `sitemap.xml`, y el propio `sitemap.xml` debe existir solo uno en la ruta raíz sin duplicados.
21-
- [ ] Todas las funciones proporcionadas por el [tema Chirpy](https://github.com/cotes2020/jekyll-theme-chirpy) deben funcionar normalmente en cada página de idioma, y si no es así, deben modificarse para que funcionen correctamente.
20+
- [x] Debe ser posible proporcionar todos los enlaces de las páginas que soportan cada idioma en el sitio sin omisiones en `sitemap.xml`, y el propio `sitemap.xml` debe existir solo uno en la ruta raíz sin duplicados.
21+
- [ ] Todas las funciones proporcionadas por el [tema Chirpy](https://github.com/cotes2020/jekyll-theme-chirpy) deben funcionar correctamente en cada página de idioma, y si no es así, deben modificarse para que funcionen correctamente.
22+
- [x] Funcionamiento correcto de características como 'Recently Updated', 'Trending Tags', etc.
23+
- [x] No se producirán advertencias de falsos positivos durante la verificación de errores de enlaces internos en el proceso de compilación utilizando GitHub Actions
24+
- [ ] Funcionamiento correcto de la función de búsqueda de publicaciones en la esquina superior derecha del blog
2225

2326
## Aplicación del plugin Polyglot
2427
Como Jekyll no admite blogs multilingües de forma nativa, se debe utilizar un plugin externo para implementar un blog multilingüe que cumpla con los requisitos anteriores. Después de buscar, encontré que [Polyglot](https://github.com/untra/polyglot) se usa ampliamente para implementar sitios web multilingües y puede satisfacer la mayoría de los requisitos anteriores, por lo que adopté este plugin.

_posts/fr/2024-11-18-how-to-support-multi-language-on-jekyll-blog-with-polyglot.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ tags:
1010
- RegExp
1111
---
1212
## Introduction
13-
Il y a environ 4 mois, début juillet 2024, j'ai ajouté la prise en charge multilingue à ce blog hébergé via GitHub Pages basé sur Jekyll en appliquant le plugin [Polyglot](https://github.com/untra/polyglot).
14-
Dans cet article, je partage les bugs rencontrés lors de l'application du plugin Polyglot, leur processus de résolution, ainsi que la méthode pour écrire l'en-tête html et le sitemap.xml en tenant compte du SEO.
13+
Il y a environ 4 mois, début juillet 2024, j'ai ajouté la prise en charge multilingue à ce blog, hébergé via Github Pages et basé sur Jekyll, en appliquant le plugin [Polyglot](https://github.com/untra/polyglot).
14+
Dans cet article, je partage les bugs rencontrés lors de l'application du plugin Polyglot au thème Chirpy et leur processus de résolution, ainsi que la méthode de rédaction de l'en-tête html et du sitemap.xml en tenant compte du SEO.
1515

1616
## Exigences
1717
- [x] Le résultat de la construction (pages web) doit pouvoir être fourni en distinguant les chemins par langue (ex. `/posts/ko/`{: .filepath}, `/posts/ja/`{: .filepath}).
18-
- [x] Afin de minimiser le temps et les efforts supplémentaires nécessaires pour la prise en charge multilingue, la langue doit pouvoir être automatiquement reconnue lors de la construction en fonction du chemin local où se trouve le fichier original Markdown (ex. `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}), sans avoir à spécifier manuellement les balises 'lang' et 'permalink' dans le YAML front matter du fichier Markdown écrit.
19-
- [x] L'en-tête de chaque page du site doit inclure les balises méta Content-Language et hreflang alternatives appropriées pour répondre aux directives SEO de Google pour la recherche multilingue.
18+
- [x] Pour minimiser le temps et les efforts supplémentaires nécessaires à la prise en charge multilingue, la langue doit pouvoir être automatiquement reconnue lors de la construction en fonction du chemin local où se trouve le fichier markdown original (ex. `/_posts/ko/`{: .filepath}, `/_posts/ja/`{: .filepath}), sans avoir à spécifier manuellement les balises 'lang' et 'permalink' dans le YAML front matter du fichier original.
19+
- [x] La partie en-tête de chaque page du site doit inclure des balises méta Content-Language appropriées et des balises alternatives hreflang pour répondre aux directives SEO pour la recherche multilingue de Google.
2020
- [x] Tous les liens des pages prenant en charge chaque langue sur le site doivent pouvoir être fournis sans omission dans `sitemap.xml`, et `sitemap.xml` lui-même ne doit exister qu'une seule fois dans le chemin racine sans duplication.
21-
- [ ] Toutes les fonctionnalités fournies par le [thème Chirpy](https://github.com/cotes2020/jekyll-theme-chirpy) doivent fonctionner normalement sur chaque page de langue, et si ce n'est pas le cas, elles doivent être modifiées pour fonctionner normalement.
21+
- [ ] Toutes les fonctionnalités fournies par le [thème Chirpy](https://github.com/cotes2020/jekyll-theme-chirpy) doivent fonctionner normalement sur chaque page de langue, et si ce n'est pas le cas, elles doivent être modifiées pour fonctionner correctement.
22+
- [x] Fonctionnement normal des fonctionnalités telles que 'Recently Updated', 'Trending Tags', etc.
23+
- [x] Pas de faux positifs (False Positive) lors de la vérification des erreurs de liens internes du site pendant le processus de construction utilisant GitHub Actions
24+
- [ ] Fonctionnement normal de la fonction de recherche de posts en haut à droite du blog
2225

2326
## Application du plugin Polyglot
2427
Comme Jekyll ne prend pas en charge nativement les blogs multilingues, il faut utiliser un plugin externe pour implémenter un blog multilingue répondant aux exigences ci-dessus. Après recherche, j'ai constaté que [Polyglot](https://github.com/untra/polyglot) est largement utilisé pour implémenter des sites web multilingues et peut satisfaire la plupart des exigences ci-dessus, j'ai donc choisi ce plugin.

_posts/ja/2024-11-18-how-to-support-multi-language-on-jekyll-blog-with-polyglot.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ tags:
1111
---
1212
## はじめに
1313
約4ヶ月前の2024年7月初め、JekyllベースでGithub Pagesを通じてホスティング中の本ブログに[Polyglot](https://github.com/untra/polyglot)プラグインを適用して多言語サポートの実装を追加しました。
14-
この記事では、Polyglotプラグインを適用する過程で発生したバグとその解決過程、そしてSEOを考慮したhtmlヘッダーとsitemap.xmlの作成方法を共有します。
14+
この記事では、ChirpyテーマにPolyglotプラグインを適用する過程で発生したバグとその解決過程、そしてSEOを考慮したhtmlヘッダーとsitemap.xmlの作成方法を共有します。
1515

1616
## 要件
1717
- [x] ビルドした結果物(ウェブページ)を言語別のパス(例:`/posts/ko/`{: .filepath}、`/posts/ja/`{: .filepath})で区別して提供できること。
18-
- [x] 多言語サポートに追加的に必要な時間と労力を可能な限り最小化するために、作成した原本のマークダウンファイルのYAML front matterに'lang'および'permalink'タグを一々指定しなくても、ビルド時に該当ファイルが位置するローカルパス(例:`/_posts/ko/`{: .filepath}、`/_posts/ja/`{: .filepath})に応じて自動的に言語を認識できること。
19-
- [x] サイト内の各ページのヘッダー部分は適切なContent-Languageメタタグとhreflang代替タグを含み、Googleの多言語検索のためのSEOガイドラインを満たすこと。
18+
- [x] 多言語サポートに追加的に必要な時間と労力を可能な限り最小化するため、作成したオリジナルのマークダウンファイルのYAML front matterに'lang'および'permalink'タグを一つ一つ指定しなくても、ビルド時にそのファイルが位置するローカルパス(例:`/_posts/ko/`{: .filepath}、`/_posts/ja/`{: .filepath})に応じて自動的に言語を認識できること。
19+
- [x] サイト内の各ページのヘッダー部分は、適切なContent-Languageメタタグとhreflang代替タグを含め、Googleの多言語検索のためのSEOガイドラインを満たすこと。
2020
- [x] サイト内で各言語をサポートするすべてのページリンクを漏れなく`sitemap.xml`で提供できること、また`sitemap.xml`自体は重複なくルートパスに1つだけ存在すること。
2121
- [ ] [Chirpyテーマ](https://github.com/cotes2020/jekyll-theme-chirpy)で提供されるすべての機能が各言語ページで正常に動作すること。そうでない場合は正常に動作するように修正すること。
22+
- [x] 'Recently Updated'、'Trending Tags'などの機能が正常に動作すること
23+
- [x] GitHub Actionsを利用したビルド過程でサイト内部リンクのエラー検証時、偽陽性(False Positive)警告が発生しないこと
24+
- [ ] ブログ右上の投稿検索機能が正常に動作すること
2225

2326
## Polyglotプラグインの適用
2427
Jekyllは多言語ブログを基本サポートしていないため、上記の要件を満たす多言語ブログの実装には外部プラグインを活用する必要があります。検索してみると[Polyglot](https://github.com/untra/polyglot)が多言語ウェブサイト実装用途でよく使われており、上記の要件のほとんどを満たすことができるため、このプラグインを採用しました。

0 commit comments

Comments
 (0)