I have my site setup, and I am getting ready to make a lot of changes to it, but I need the layout and SEO finished first. After running Lighthouse by Google, I noticed all my SEO tips were good, minus that the Canonical link was pointing to my VPS and not to my site url. After some quick google search, I found out that I could just edit in a for the Canonical:
To my knowledge the way Jekyll SEO Tag works is it will prepend your page.url with the domain and baseurl (if used) based on the values in your _config.yml
These would be:
url: "http://yourdomain.com"
baseurl: "/some-subfolder" # typically not used unless you host your site in subfolder
The custom canonical_url variable it mentions is for a specific page. Youâd put this in itâs YAML Front Matter if you need to override itâs value.
An example of when youâd do this is if you are cross posting a blog post on your site from another source, and want to use that siteâs URL instead to send some link juice to that page.
title: My Cross Posted Article
canonical_url: 'https://someotherdomain.com/original-article-url'
(where âmiscâ would be the actual page name). The plugin DOES respond to per-page front matter like
canonical_url: "https://michaelbach.de"
and it generates all the other meta tags correctly, so itâs not broken. I have perused the pertinent document pages http://jekyll.github.io/jekyll-seo-tag/ carefully, compared to the jekyll install new output, reviewed my _config.yml, but no dice. Advice?
Thanking in advance, Michael
If youâre getting URLs like http://0.0.0.0:4000/ when youâre building instead of what is set in url, that is due to not using the proper environment flags.
By default Jekyll builds in development which is why youâre not seeing the production url of https://michaelbach.de prepend your URLs.