Skip to content

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

@IlCallo

Description

@IlCallo

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"],
    ])
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions