{{- if .IsTranslated -}}
{{ range first 1 .AllTranslations }}
<link rel="alternate" hreflang="x-default" href="{{ .Permalink }}" />
{{- end -}}
{{ range .AllTranslations }}
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" />
{{- end -}}
{{ end }}
The code above finds which other pages the multi lang page is linked to and assigns values to them for SEO.
<link rel="alternate" hreflang="x-default" href="http://localhost:1313/tr/" />
<link rel="alternate "hreflang="tr" href="http://localhost:1313/tr/" />
<link rel="alternate "hreflang="en" href="http://localhost:1313/" />
As you can see, the "x-default"
parameter corresponds to the TR page.
Instead of the TR page I want to make this link in English, i.e. without any url prefix (http://localhost:1313/
)
The default language in my config.toml file is already English.
How can I do this?