I generate HTML5 output in multiple languages. Google recommends including the hreflang attribute to direct users to the content appropriate for their language/region. Google explains that there are a few ways to incorporate the hreflang attribute: https://support.google.com/webmasters/a ... 9077?hl=en
Has anyone used hreflang? If so, do you add it to the <head> section of your master pages? It looks like I could also add it to the sitemap, but I think I'd have to do that manually every time I build the HTML target.
hreflang
-
- Propeller Head
- Posts: 54
- Joined: Tue Mar 15, 2016 9:57 am
- Location: Los Angeles, CA
hreflang
Bianca Ragsdale
www.linkedin.com/in/biancaragsdale
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx
Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx
www.linkedin.com/in/biancaragsdale
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx
Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx
Re: hreflang
Do you have one target per language? If so I'd use the meta tags option in the target itself.
-
- Propeller Head
- Posts: 54
- Joined: Tue Mar 15, 2016 9:57 am
- Location: Los Angeles, CA
Re: hreflang
Hi Alex,
Great tip! However, I copied the text into the "Add meta tags to content" field, and I got an "Invalid XML" warning from Flare. When I build the target, the code doesn't show up in the <head> section. Any idea why Flare wouldn't support the code? I'm using the format that Google says to use:
<link rel="alternate" hreflang="es" href="http://es.example.com/" />
Once again, this is the page from Google: https://support.google.com/webmasters/a ... 9077?hl=en
Great tip! However, I copied the text into the "Add meta tags to content" field, and I got an "Invalid XML" warning from Flare. When I build the target, the code doesn't show up in the <head> section. Any idea why Flare wouldn't support the code? I'm using the format that Google says to use:
<link rel="alternate" hreflang="es" href="http://es.example.com/" />
Once again, this is the page from Google: https://support.google.com/webmasters/a ... 9077?hl=en
Bianca Ragsdale
www.linkedin.com/in/biancaragsdale
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx
Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx
www.linkedin.com/in/biancaragsdale
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx
Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx
Re: hreflang
Seems I gave you duff advice and Flare enforces these tags beginning with "<meta", sorry about that.
MasterPages will work fine for this, especially if you always have a Spanish (for example) equivalent page. You could get a little clever with the href link and some variables if you wanted to, but you'd only need to do this if the language you translated into varied from time to time, which I doubt.
MasterPages will work fine for this, especially if you always have a Spanish (for example) equivalent page. You could get a little clever with the href link and some variables if you wanted to, but you'd only need to do this if the language you translated into varied from time to time, which I doubt.
-
- Propeller Head
- Posts: 54
- Joined: Tue Mar 15, 2016 9:57 am
- Location: Los Angeles, CA
Re: hreflang
Hi Alex,
No worries! I'm glad you brought up the "Add meta tags.." field, because I didn't realize that option even existed. I might be able to put it to good use!
Also, I submitted a feature request, asking that MadCap expands the type of code allowed in the "Add meta tags..." field, so that other code could be added.
Thanks,
Bianca
No worries! I'm glad you brought up the "Add meta tags.." field, because I didn't realize that option even existed. I might be able to put it to good use!
Also, I submitted a feature request, asking that MadCap expands the type of code allowed in the "Add meta tags..." field, so that other code could be added.
Thanks,
Bianca
Bianca Ragsdale
www.linkedin.com/in/biancaragsdale
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx
Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx
www.linkedin.com/in/biancaragsdale
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx
Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx