有没有办法在shopify中对子文件夹实施hreflang
Here my current custom code in shopify.
<link rel="alternate" hreflang="en-au" href="{{ canonical_url | replace: 'us', 'au' }}" />
输出通过源代码如上所述,
<link rel="alternate" hreflang="en-au" href="/en-au/pages/faqs" />
上面代码的问题是,当访问者在UK等其他国家 /地区查看它时,它不会 /en-uk在URL中。我正在尝试使其更加动态,以便我可以在其他国家 /地区实施。这是我尝试过的代码,但在Shopify中显示出错误的错误
<link rel="alternate" hreflang="en-au" href="{{ canonical_url | replace: '{{ localization.country.iso_code }}', 'au' }}" />
Here my current custom code in shopify.
<link rel="alternate" hreflang="en-au" href="{{ canonical_url | replace: 'us', 'au' }}" />
the output goes like this via source code
<link rel="alternate" hreflang="en-au" href="/en-au/pages/faqs" />
The problem with the code above is that when visitors view it in other country like UK it won't /en-uk in the URL. I am trying to get to make it more dynamic after /en- so that I can implement on other countries. Here is the code I've tried but it gets error showing "liquid error" in Shopify
<link rel="alternate" hreflang="en-au" href="{{ canonical_url | replace: '{{ localization.country.iso_code }}', 'au' }}" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您认为您的最后一部分会起作用,则只需在变量中提取第二个液体代码即可使用它。
这是我的意思:
而不是
喜欢
If you think that your last part will work, you simply have to extract the second liquid code in a variable and use it.
Here is what I mean:
Instead of
do like