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

Allow overriding variables in all ogp namespaces #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrtndwrd
Copy link
Contributor

@mrtndwrd mrtndwrd commented May 6, 2021

Under normal circumstances, if you use several namespaces, middleman-ogp will only allow you to override variables in the og namspace by defining them as page variables. Take this index.md as an example:

title: My Index Page
description: My index page looks great!
---
# Welcome

I'm one of those people that writes welcome on their home page.

And let's assume this is our config.rb:

activate :ogp do |ogp|
  ogp.namespaces = {
    og: data.ogp.og,
    twitter: data.ogp.twitter
  }
end

The og tags for this page would look something like:

    <meta property="og:title" content="My Index Page" />
    <meta property="og:description" content="My index page looks great!" />
    <meta property="twitter:description" content="whatever description I have in data/ogp/twitter.yml" />
    <meta property="twitter:title" content="whatever title I have in data/ogp/twitter.yml" />

I want the Twitter description and title to be my overridden variable as well. This PR makes that possible.

@mrtndwrd mrtndwrd mentioned this pull request Oct 5, 2021
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

Successfully merging this pull request may close these issues.

None yet

1 participant