lang_from_path 设置 setting to derive document lang from relative path
This release adds a new boolean configuration setting lang_from_path. When set to true, this option tells polyglot to derive the base language from a matching subpath if the lang frontmatter is not set. This setting works well in conjunction with other translation maintenance tools such as po4a.
相对和绝对 url 的相对化逻辑优化
excluded_from_localization files will have trailing slashes added to their paths if they are directories. In addition, these files will be matched differently in the relativize and absolute url regex matchers. This will improve the accuracy of url relativization based on user feedback.
请把这些标签和你的网站的 url 一同放入你的 includes 文件夹下的 head.html 文件中,以此获得最大化的多语言站点 SEO 。其效果与如下 Liquid 代码等同:
<metahttp-equiv="Content-Language"content="{{site.active_lang}}"><linkrel="alternate"hreflang="{{site.default_lang}}"href="http://yoursite.com{{page.permalink}}"/>
{% for lang in site.languages %}
{% if lang == site.default_lang %}
{% continue %}
{% endif %}
<linkrel="alternate"hreflang="{{lang}}"href="http://yoursite.com/{{lang}}{{page.permalink}}"/>
{% endfor %}
同样是要放在你的网页 header 中,但是 Polyglot 的方案更加快捷清晰!若需更多详情,请参照 SEO 页面。