tiste / middleman-meta-tags

Easy integration of meta tags into your Middleman applications
rubygems.org/gems/middleman-meta-tags
MIT License
65 stars 19 forks source link

Only getting the twitter:card meta tag #7

Closed Mopster closed 9 years ago

Mopster commented 9 years ago

I installed the gem and followed the readme, but both the

display_meta_tags

and

auto_display_meta_tags

are only printing the following line :

<meta content="summary_large_image" name="twitter:card">

The 'site' variable isn't being read from the 'data/site.yml'. The title and description are also not taken from the frontmatter of my index page or an article page.

My Gemfile :

source 'http://rubygems.org'

gem "middleman", "~> 3.3.12"
gem "middleman-blog", "~> 3.5.3"
gem "middleman-livereload", "~> 3.3.0"
gem "middleman-rouge"
gem "redcarpet"
gem 'middleman-meta-tags'
gem 'middleman-navtree'

# For feed.xml.builder
gem "builder", "~> 3.0"                        

In config.rg :

###
# Meta tags
###
activate :meta_tags

In the of the layouts/layout.erb :

    <%= auto_display_meta_tags =%>
    <%= display_meta_tags site: 'test'=%>

The data/site.yml file :


---
site: TEST META
Mopster commented 9 years ago

Ok, the site.yml in /data works, I had it located at the wrong place. But the default values stored in site.yml are not being overwritten by the page meta information.

tiste commented 9 years ago

You shouldn't use both auto_display_meta_tags and display_meta_tags site: 'test'. If you want, you could do something like auto_display_meta_tags site: 'ok'

tiste commented 9 years ago

Is it working now @Mopster?

Mopster commented 9 years ago

I'll be giving it another go on Monday. I used both lines to test them, I used them seperately, but they both only give the twitter meta tag and the default site.yml information. The info written in the frontmatter on the documents are not being used to override the default info.

Mopster commented 9 years ago

I started a new site with the middleman-blog template and added the meta-tags gem en follows the readme instructions, you can see the result in the screenshot below. The site.yml data is being printed, but the frontmatter title and description data are not being used.

screenshot from 2015-05-25 12 49 17

tiste commented 9 years ago

Please refer to the README! Either use set_meta_tags title: 'Relevant title' for non-common tags or title 'Relevant title' for common ones. You can also set values with the display_meta_tags or auto_display_meta_tags. Frontmatter can't be used with dynamic values (I mean, data/ or ruby variables).