kpumuk / meta-tags

Search Engine Optimization (SEO) for Ruby on Rails applications.
MIT License
2.73k stars 275 forks source link

Can’t get started #211

Open jeffcovey opened 4 years ago

jeffcovey commented 4 years ago

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 commented 4 years ago

Same problem

airled commented 4 years ago

Same issue

Tressa-Sanders commented 4 years ago

I had this issue but also had Site Name 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 tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/jeffcovey"><img src="https://avatars.githubusercontent.com/u/759948?v=4" />jeffcovey</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>I had this issue but also had <title>Site Name 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 tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.</p> </blockquote> <p>I’m afraid this isn’t the answer for me. I don’t have <code><title></code> set in addition to <code>display_meta_tags</code>.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/appstronauten"><img src="https://avatars.githubusercontent.com/u/15111709?v=4" />appstronauten</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>I had this issue but also had <title>Site Name 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 tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.</p> </blockquote> <p>Worked for me - Thanks Tressa-Sanders!</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Tressa-Sanders"><img src="https://avatars.githubusercontent.com/u/39808139?v=4" />Tressa-Sanders</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <blockquote> <blockquote> <p>I had this issue but also had <title>Site Name 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 tags just got ignored. Maybe I'm wrong. Oh, well, it's working now.</p> </blockquote> <p>Worked for me - Thanks Tressa-Sanders!</p> </blockquote> <p>Awesome! It's always the little things that getcha. 👍 </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/jeffcovey"><img src="https://avatars.githubusercontent.com/u/759948?v=4" />jeffcovey</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>Hmmm but it looks like you have this in the body: = title 'page title'</p> </blockquote> <p>Sorry, I should have said that my five-month-old question no longer reflects what I’m doing now. 🙂</p> <p>Now I’m using:</p> <pre> = 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' </pre> <p>I still get just the title of the page in <code><title></code>.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>