Skip to content

Instantly share code, notes, and snippets.

@grayside
Created January 30, 2017 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grayside/5efbbc42e0b7758930d9a0a58e7aec90 to your computer and use it in GitHub Desktop.
Save grayside/5efbbc42e0b7758930d9a0a58e7aec90 to your computer and use it in GitHub Desktop.
Example Metatag JSON output definition via JSON Schema from Schemata module with some custom code #Drupal8
{
"field_meta_tags": {
"type": "array",
"title": "Meta Tags",
"items": {
"type": "object",
"properties": {
"value": {
"type": "object",
"title": "Metatag",
"properties": {
"abstract": {
"title": "Abstract",
"description": "A brief and concise summary of the page's content, preferably 150 characters or less. The description meta tag may be used by search engines to display a snippet about the page in search results.",
"type": "string"
},
"canonical_url": {
"title": "Canonical URL",
"description": "Preferred page location or URL to help eliminate duplicate content for search engines.",
"type": "string",
"format": "uri"
},
"content_language": {
"title": "Content Language",
"description": "Used to define this page's language code. May be the two letter language code, e.g. \"de\" for German, or the two letter code with a dash and the two letter ISO country code, e.g. \"de-AT\" for German in Austria. Still used by Bing",
"type": "string"
},
"description": {
"title": "Description",
"description": "A brief and concise summary of the page's content, preferably 150 characters or less. The description meta tag may be used by search engines to display a snippet about the page in search results.",
"type": "string"
},
"generator": {
"title": "Generator",
"description": "Describes the name and version number of the software or publishing tool used to create the page.",
"type": "string"
},
"geo_placename": {
"title": "Geographical place name",
"description": "A location's formal name.",
"type": "string"
},
"geo_position": {
"title": "Geographical position",
"description": "Geo-spatial information in 'latitude, longitude' format, e.g. '50.167958, -97.133185'; <a href='http://en.wikipedia.org/wiki/ICBM'>see Wikipedia for details</a>.",
"type": "string"
},
"geo_region": {
"title": "Geographical region",
"description": "A location's two-letter international country code, with an optional two-letter region, e.g. 'US-NH' for New Hampshire in the USA.",
"type": "string"
},
"icbm": {
"title": "ICBM",
"description": "Geo-spatial information in 'latitude, longitude' format, e.g. '50.167958, -97.133185'; <a href='https://en.wikipedia.org/wiki/ICBM_address'>see Wikipedia for details</a>.",
"type": "string"
},
"image_src": {
"title": "Image",
"description": "An image associated with this page, for use as a thumbnail in social networks and other services.",
"type": "string",
"format": "uri"
},
"keywords": {
"title": "Keywords",
"description": "A comma-separated list of keywords about the page. This meta tag is <em>not</em> supported by most search engines anymore.",
"type": "string"
},
"news_keywords": {
"title": "News Keywords",
"description": "A comma-separated list of keywords about the page. This meta tag is used as an indicator in <a href='https://support.google.com/news/publisher/bin/answer.py?hl=en&amp;answer=68297'>Google News</a>.",
"type": "string"
},
"original_source": {
"title": "Original source",
"description": "Used to indicate the URL that broke the story, and can link to either an internal URL or an external source. If the full URL is not known it is acceptable to use a partial URL or just the domain name.",
"type": "string",
"format": "uri"
},
"referrer": {
"title": "Referrer policy",
"description": "Indicate to search engines and other page scrapers whether or not links should be followed. See <a href='http://w3c.github.io/webappsec/specs/referrer-policy/'>the W3C specifications</a> for further details.",
"type": "string"
},
"rights": {
"title": "Rights",
"description": "Details about intellectual property, such as copyright or trademarks; does not automatically protect the site's content or intellectual property.",
"type": "string"
},
"robots": {
"title": "Robots",
"description": "Provides search engines with specific directions for what to do when this page is indexed.",
"type": "string"
},
"shortlink": {
"title": "Shortlink URL",
"description": "A brief URL, often created by a URL shortening service.",
"type": "string",
"format": "uri"
},
"standout": {
"title": "Standout",
"description": "Highlight standout journalism on the web, especially for breaking news; used as an indicator in <a href='https://support.google.com/news/publisher/bin/answer.py?hl=en&amp;answer=68297'>Google News</a>. Warning: Don't abuse it, to be used a maximum of 7 times per calendar week!",
"type": "string"
},
"title": {
"title": "Page title",
"description": "The text to display in the title bar of a visitor's web browser when they view this page. This meta tag may also be used as the title of the page when a visitor bookmarks or favorites this page. It is common to append '[site:name]' to the end of this, so the site's name is automatically added.",
"type": "string"
}
}
}
},
"required": [
"value"
]
},
"default": [
{
"value": "a:1:{s:5:\"title\";s:34:\"[current-page:title] | [site:name]\";}"
}
],
"maxItems": 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment