File: 2024-03-17-polyglot-1.8.0.md

package info (click to toggle)
ruby-jekyll-polyglot 1.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,196 kB
  • sloc: xml: 1,500; ruby: 947; sh: 10; makefile: 4
file content (43 lines) | stat: -rw-r--r-- 2,187 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
layout: post
title: Polyglot 1.8.0 - 社区贡献发布
lang: zh-CN
---

非常兴奋地宣布 Jekyll-Polyglot 1.8.0 版本发布了,这个版本增加了一些功能改进,并认可了来自社区的文档和贡献!

## 不同语言的专属永久链接

Polyglot 1.8.0 版本增加了一些新功能,可以为页面设置特定于语言的永久链接,并保留它们与其他相关页面的关联。这个新功能由一位绅士和学者—— **[antoniovazquezblanco](https://github.com/antoniovazquezblanco)** 提供。

## 网站地图生成和 i18n SEO

这个版本还认可了 **[jerturowetz](https://github.com/jerturowetz)** 提供的高质量 [sitemap.xml]({{ site.url }}/sitemap.xml) 和 [robots.txt]({{ site.url }}/robots.txt) 解决方案。本网站现在通过这些文件更好地展示和捕获了搜索引擎提供的 SEO 力量。可以在[这里](https://github.com/untra/polyglot/tree/master/site)查看示例网站的文件。

## jekyll :polyglot :post_write 钩子

GitHub 用户 **[obfusk](https://github.com/obfusk)** 在几年前贡献了一个[微小的 PR](https://github.com/untra/polyglot/pull/142):

通过多语言 `:site, :post_write` 钩子,像这样为每个子进程运行:

```rb
Jekyll::Hooks.register :site, :post_write do |site|
  ...
end
```

这个版本增加了一个自定义 `:post_write` 钩子,它在所有语言处理完成后运行一次(无论是否使用 `parallel_localization`):

```rb
Jekyll::Hooks.register :polyglot, :post_write do |site|
  # do something amazing here!
end
```

这一特性对于使用了 [Jekyll hook 插件](https://jekyllrb.com/docs/plugins/hooks/)的复杂的 Jekyll 静态站点非常有用。

她还为[语言子进程崩溃时的额外日志记录](https://github.com/untra/polyglot/pull/145)提供了修复。感谢这个贡献!

## 本地化变量和葡萄牙语翻译

**[george-gca](https://github.com/george-gca)** 是一个才华横溢的、很棒的家伙,他为如何最好地从站点数据本地化富文本贡献了[一整篇博客文章](/2024/02/29/localized-variables/)。他还提供了[本站的葡萄牙语翻译](https://polyglot.untra.io/pt-BR/)。