Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal : Improve SEO with <link rel="alternate"> #20

Closed
sachaarbonel opened this issue Sep 22, 2020 · 3 comments
Closed

Proposal : Improve SEO with <link rel="alternate"> #20

sachaarbonel opened this issue Sep 22, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@sachaarbonel
Copy link

sachaarbonel commented Sep 22, 2020

Hi themefisher team, thank's for this great theme! It seems to me that is a good SEO practice. Also ghost have a section on this

@tfsomrat tfsomrat added the enhancement New feature or request label Sep 23, 2020
@tfsomrat
Copy link
Contributor

Hey @sachaarbonel

Thanks for your concern. I didn't get it properly what you said, can you please explain in details so we can improve our theme. Or it will be great if you make a pull request.

@sachaarbonel
Copy link
Author

sachaarbonel commented Sep 24, 2020

Explanations

As I understand, when you have a multilingual blog, google can flag your content as duplicate if you don't add <link rel="alternate"> tag in <head>

What I did in my fork

I did something like this in layouts/partials/head.html :

{{ "<!-- multilingual SEO optimizations -->" | safeHTML }}
  {{ if .IsTranslated }}
      {{ range .Translations }}
          <link rel="alternate" hreflang="{{ .Lang }}" href="https://gallant-kirch-993286.netlify.app{{ .Permalink }}">
      {{ end }}

  {{ end }}

Sorry for the ugly hardcoded url but still new to gohugo and I tried everything but my baseUrl doesn't seem to work.

@tfsomrat
Copy link
Contributor

@sachaarbonel

I am implementing this code. Thanks for being with themefisher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants