Open adius opened 7 years ago
It should be installed already as a dependency of the github-pages
gem. You would however need to enable it in your _config.yml
like this:
gems:
- jekyll-seo-tag
It is enabled 😕
Any ideas?
@adius could you supply your _layouts/default.html
file?
@siliconmeadow Yes, but nothing interesting to see there
<!doctype html>
<html>
<head>
<meta charset=utf-8 />
<meta name=viewport content="width=device-width, initial-scale=1">
<link rel=stylesheet media=all href=/css/screen.css>
<link rel="shortcut icon" href=/img/favicon.png>
<link
rel=stylesheet
href=//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css>
<link
href=/atom.xml
rel=alternate
title="Adrian Sieber"
type=application/atom+xml>
{% seo %}
</head>
<body>
…
I've never used this gem before, but looking at http://jekyll.github.io/jekyll-seo-tag/installation/ , it says that you need to add this prior to the <head>
tag:
<!-- Begin Jekyll SEO tag v2.3.0 -->
<title>Installing Jekyll SEO Tag | Jekyll SEO Tag</title>
<meta property="og:title" content="Installing Jekyll SEO Tag" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A Jekyll plugin to add metadata tags for search engines and social networks to better index and display your site’s content." />
<meta property="og:description" content="A Jekyll plugin to add metadata tags for search engines and social networks to better index and display your site’s content." />
<link rel="canonical" href="http://jekyll.github.io/jekyll-seo-tag/installation/" />
<meta property="og:url" content="http://jekyll.github.io/jekyll-seo-tag/installation/" />
<meta property="og:site_name" content="Jekyll SEO Tag" />
<script type="application/ld+json">
{"name":null,"description":"A Jekyll plugin to add metadata tags for search engines and social networks to better index and display your site’s content.","author":null,"@type":"WebPage","url":"http://jekyll.github.io/jekyll-seo-tag/installation/","image":null,"publisher":null,"headline":"Installing Jekyll SEO Tag","dateModified":null,"datePublished":null,"sameAs":null,"mainEntityOfPage":null,"@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->
I don't know if that would help?
My mistake - just prior to the closing </head>
tag - ignore my previous comment.
I'm looking through the issues, and it looks like others have an _includes/head/seo.html
file which shows some other ways it appears they've defined {% seo %}
.
What I'm wondering is whether the problem with the jekyll-seo-tag gem in your circumstance is not that the gem isn't installed in the docker image, but that it's not correctly invoked in your templates?
No, I don't think so. I've been using the plugin before with https://github.com/github/pages-gem and it worked like a charm, but I'm sick of dealing with ruby & bundler issues and that's why I wanted to use a docker based solution...
Yeah, ruby and bundler is such a mess... 😠
Long shot @adius but you might try stopping the container, deleting your Gemfile.lock and bringing docker up again to force bundler to start over. I had some weirdness with jekyll gems that went away when I blew the lock file away.
Thanks a lot @smeyfroi. This wasn't exactly the problem, but it led me on the right way. The problem was that I didn't have a Gemfile at all 🙈 . I thought it wasn't necessary, as all dependencies are already preinstalled in the docker container.
The Liquid Exception: Liquid syntax error (line 16): Unknown tag 'seo' in /_layouts/default.html
error doesn't suggest that the Gemfile is missing either.
How should this be fixed? A warning if the Gemfile is missing? Or automatically adding one?
@adius Nice!
It is confusing, and not really explained very well in the jekyll docs (that I could find anyway).
So perhaps document that both a Gemfile and the _config.yml gems
declaration is required? New plugins require additions to both files.
Also maybe worth explaining that bundler is invoked during container startup: I found myself reading the Dockerfile to understand what was going on.
And the problem I had was with gem dependency conflicts that went away when I deleted the Gemfile.lock. So perhaps that's worth noting in the docs as well, as a troubleshooting thing?
Great writeput @smeyfroi 👍 We should definitely add this to the project README I think.
I can take a look and raise a PR over the next couple days.