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

Can’t get started #211

Open
jeffcovey opened this issue Apr 29, 2020 · 7 comments
Open

Can’t get started #211

jeffcovey opened this issue Apr 29, 2020 · 7 comments

Comments

@jeffcovey
Copy link

jeffcovey commented Apr 29, 2020

Hello, everyone!

I'm sorry to say I can't seem to get started with this gem. Following the instructions, I've installed it and added this to app/views/layouts/application.html.slim:

doctype html
  html
    head
      = display_meta_tags site: "My site's name"
[...]
    body
      h1.pb-2.text-center
        = title 'page title'

The page title is set as a variable from the view, but you get the idea. I've tried setting it as an interpolated variable and as a simple string.

The documentation says: "When views are rendered, the page title will be included in the right spots", but... it's not. The <title> tag contains only the name of the site. The name of the specific page is absent. Can anyone tell me what I'm doing incorrectly?

Thanks very much,
Jeff

@appstronauten
Copy link

Same problem

@airled
Copy link

airled commented Jun 21, 2020

Same issue

@Tressa-Sanders
Copy link

Tressa-Sanders commented Sep 2, 2020

I had this issue but also had <title>Site Name</title> just above the display_meta_tags line and when I removed it, it all started working. Strange though because I swear I have older sites that are setup like that and the <title> tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.

@jeffcovey
Copy link
Author

I had this issue but also had <title>Site Name</title> just above the display_meta_tags line and when I removed it, it all started working. Strange though because I swear I have older sites that are setup like that and the <title> tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.

I’m afraid this isn’t the answer for me. I don’t have <title> set in addition to display_meta_tags.

@appstronauten
Copy link

appstronauten commented Sep 13, 2020

I had this issue but also had <title>Site Name</title> just above the display_meta_tags line and when I removed it, it all started working. Strange though because I swear I have older sites that are setup like that and the <title> tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.

Worked for me - Thanks Tressa-Sanders!

@Tressa-Sanders
Copy link

I had this issue but also had <title>Site Name</title> just above the display_meta_tags line and when I removed it, it all started working. Strange though because I swear I have older sites that are setup like that and the <title> tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.

Worked for me - Thanks Tressa-Sanders!

Awesome! It's always the little things that getcha. 👍

@jeffcovey
Copy link
Author

Hmmm but it looks like you have this in the body:
= title 'page title'

Sorry, I should have said that my five-month-old question no longer reflects what I’m doing now. 🙂

Now I’m using:

= display_meta_tags site: 'site title',
      title: 'page title',
      og: { title: 'page title', site_name: 'site title' },
      image_src: image_url('front.jpg'),
      keywords: 'foo, bar, baz',
      description: 'yada yada'

I still get just the title of the page in <title>.

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