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

Add "metaTags" function to build up the whole "meta" object #2

Open
IlCallo opened this issue Oct 9, 2020 · 0 comments
Open

Add "metaTags" function to build up the whole "meta" object #2

IlCallo opened this issue Oct 9, 2020 · 0 comments

Comments

@IlCallo
Copy link
Member

IlCallo commented Oct 9, 2020

Provide a function which automatically builds the meta object

Current way:

  meta: {
    meta: {
      ...metaTag(["description", "og:description"], "My description"),
      ...metaTag("twitter:card", "summary"),
      ...metaTag("twitter:site", "@nytimesbits"),
      ...metaTag("twitter:creator", "@nickbilton"),
    },
  },

Possible new API

  meta: {
    meta: metaTags([
      [["description", "og:description"], "My description"],
      ["twitter:card", "summary"],
      ["twitter:site", "@nytimesbits"],
      ["twitter:creator", "@nickbilton"],
    ])
  },

If possible find a way to hide "meta.meta" nesting, even if we need a way to manage all other root meta fields

  // Automatically returns an object with "meta" property
  meta: metaTags([
    [["description", "og:description"], "My description"],
    ["twitter:card", "summary"],
    ["twitter:site", "@nytimesbits"],
    ["twitter:creator", "@nickbilton"],
  ]),
  meta: {
    title: 'MyTitle',
    ...metaTags([
      [["description", "og:description"], "My description"],
      ["twitter:card", "summary"],
      ["twitter:site", "@nytimesbits"],
      ["twitter:creator", "@nickbilton"],
    ])
  }
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

1 participant