Easier website development with Web Components and JSON-LD
Stay organized with collections
Save and categorize content based on your preferences.
Monday, March 09, 2015
JSON-LD is a JSON-based data format
that can be used to implement
structured data
describing content on your site to Google and other search engines. For example, if you have a
list of events, cafes, people or more, you can include this data in your pages in a structured way
using the schema.org vocabulary embedded in
webpages as a JSON-LD snippet. The structured data helps Google understand your pages better and
highlight your content in search features, such
events in the Knowledge Graph
and
rich snippets.
Web Components are a nascent set of
technologies to define custom, reusable user interface widgets and their behavior. Any web
developer can build a Web Component. You start by defining a
template
for a distinct part of the user interface, which you
import into the pages
on which you want to use the Web Component. A
Custom Element
is used to define the behavior of the Web Component. Because you're bundling the display and logic
for part of the user interface into the Web Component, you can share and reuse the bundle on other
pages and with other developers, thus simplifying web development.
JSON-LD and Web Components work really well together. The Custom Element functions as the
presentation layer and the JSON-LD functions as the data layer that the custom element and search
engines consume. This means you can build custom elements for any schema.org type, such as
Event and
LocalBusiness.
Your architecture would then look like this. Your structured data is stored in your database, for
example, the store locations in your chain. This data is embedded into your webpage as a JSON-LD
snippet, which means it's available to be consumed by the Custom Element to display to a human
visitor and for Googlebot to retrieve for Google indexing.
To learn more and get started with your own custom elements, please see:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["JSON-LD is a JSON-based format used for implementing structured data on websites, enhancing search engine understanding and visibility."],["Web Components enable the creation of reusable UI widgets by bundling display and logic, simplifying web development."],["JSON-LD and Web Components work together, with JSON-LD as the data layer consumed by Web Components (presentation layer) and search engines."],["This synergy allows for building custom elements for any schema.org type, improving data representation and searchability."],["Structured data stored in a database can be embedded as JSON-LD on webpages, benefiting both human visitors and search engine indexing."]]],["JSON-LD is a structured data format, using schema.org vocabulary, that helps search engines understand website content like events or businesses. Web Components define reusable UI widgets with custom behavior. These two work together: Web Components display content, while JSON-LD provides the data layer for both the component and search engines. Data is stored, embedded into web pages as JSON-LD, and then displayed by the Web Components. This setup enables building custom elements for various schema.org types.\n"]]