-
Notifications
You must be signed in to change notification settings - Fork 298
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
Strange /index postfix after URLs #482
Comments
I suggest trying |
According to the docs:
means:
I migrated a Wordpress blog that used the permalink structure mentioned above (no month, no day, no year) I don't want to change permalink structure otherwise my page indexed on Google will be broken. Moreover, Github Pages doesn't allow 301 redirect. So my only solution is to mantain my old link structure. Going back to my question? Why Jekyll SEO Tags adds this extra
Why Jekyll SEO Tags doesn't respect the desired permalink declared? |
This is how the plugin implements def canonical_url
@canonical_url ||= begin
if page["canonical_url"].to_s.empty?
filters.absolute_url(page["url"]).to_s.gsub(%r!/index\.html$!, "/")
else
page["canonical_url"]
end
end
end Your site has a custom implementation of the same method via a local plugin: def canonical_url
@canonical_url ||= begin
if page["canonical_url"].to_s.empty?
filters.absolute_url(page["url"]).to_s.gsub(%r!\.html$!, "")
else
page["canonical_url"]
end
end
end I don't see any explanation behind your custom implementation in the commit message. So, I would try deleting the custom code and see if that fixes the issue. |
Custom implementation? Oh you're right. Now I remember. The only problem I see (that Screming Frog doesn't detect) is these link elements in blog and category pages:
that use a format different by the canonical URL adding the index.html at the end. Is this line missing for these items in your code?
On this page you can see the problem: |
Yes, I see the issue in the pagination-pages. The reason for that is: jekyll-seo-tag/lib/template.html Lines 52 to 59 in 6005f93
Complaints about above code should be with a new issue ticket. The current ticket seems to be resolved at this point. |
Ok thx. I am going to open it. Thank you for your help. |
Hi,
This is my website: https://www.code4projects.net/
I use Jekyll SEO Tags and I noticed that canonical URLs for categories and blog pages have an additional
/index
at the end of URLs like here:https://www.code4projects.net/category/cloud/
https://www.code4projects.net/blog/
I migrated my blog from Wordpress where I used permalinks with trailing slashes.
Source code of my blog is here:
https://github.com/sasadangelo/code4projects
Template for blog and categories are here:
https://raw.githubusercontent.com/sasadangelo/code4projects/main/blog/index.md
https://raw.githubusercontent.com/sasadangelo/code4projects/main/category/cloud.md
in both the cases permalink should be:
but in link canonical Jekyll SEO Tags add an additional
/index
and in link next/prev add/index.html
.This generates a lot of problems in Google Search Console.
What can I do to fix the issues?
The text was updated successfully, but these errors were encountered: