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

jekyll-seo-tag does not seem to be supported #16

Open
adius opened this issue Aug 31, 2017 · 15 comments
Open

jekyll-seo-tag does not seem to be supported #16

adius opened this issue Aug 31, 2017 · 15 comments
Assignees

Comments

@adius
Copy link

adius commented Aug 31, 2017

 $ docker run -v "$PWD":/usr/src/app -p "4000:4000" starefossen/github-pages
Configuration file: /usr/src/app/_config.yml
Configuration file: /usr/src/app/_config.yml
            Source: /usr/src/app
       Destination: /_site
 Incremental build: enabled
      Generating...
  Liquid Exception: Liquid syntax error (line 16): Unknown tag 'seo' in /_layouts/default.html
jekyll 3.4.5 | Error:  Liquid syntax error (line 16): Unknown tag 'seo'
@Starefossen
Copy link
Owner

Starefossen commented Aug 31, 2017

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

@adius
Copy link
Author

adius commented Sep 1, 2017

It is enabled 😕

@Starefossen Starefossen self-assigned this Sep 3, 2017
@adius
Copy link
Author

adius commented Sep 27, 2017

Any ideas?

@siliconmeadow
Copy link
Collaborator

@adius could you supply your _layouts/default.html file?

@adius
Copy link
Author

adius commented Sep 28, 2017

@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>

@siliconmeadow
Copy link
Collaborator

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?

@siliconmeadow
Copy link
Collaborator

siliconmeadow commented Sep 28, 2017

My mistake - just prior to the closing </head> tag - ignore my previous comment.

@siliconmeadow
Copy link
Collaborator

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?

@adius
Copy link
Author

adius commented Sep 28, 2017

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...

@Starefossen
Copy link
Owner

Yeah, ruby and bundler is such a mess... 😠

@smeyfroi
Copy link

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.

@adius
Copy link
Author

adius commented Sep 29, 2017

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?

@smeyfroi
Copy link

@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?

@Starefossen
Copy link
Owner

Great writeput @smeyfroi 👍 We should definitely add this to the project README I think.

@smeyfroi
Copy link

smeyfroi commented Oct 2, 2017

I can take a look and raise a PR over the next couple days.

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

No branches or pull requests

4 participants