Fix meta tags for translated pages
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
# Copyright 2019 Signal
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all copies or
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all copies or
|
||||
# substantial portions of the Software.
|
||||
#
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
||||
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
@ -28,7 +28,7 @@ module Jekyll
|
||||
|
||||
if page["translate"]
|
||||
dir = page["src_dir"].nil? ? page["dir"] : page["src_dir"]
|
||||
hreflangs = %{<link rel="alternate" hreflang="en" href="#{site.config["production_url"]}#{dir}" />}
|
||||
hreflangs = %{<link rel="alternate" hreflang="en" href="#{site.config["production_url"]}#{dir}" /><link rel="alternate" hreflang="x-default" href="#{site.config["production_url"]}#{dir}" />}
|
||||
|
||||
site.data["languages"].each_key do |language|
|
||||
hreflangs << %{<link rel="alternate" hreflang="#{language.tr('_', '-')}" href="#{site.config["production_url"]}/#{language}#{dir}" />}
|
||||
|
Reference in New Issue
Block a user