Static Schema
This schema is hard-coded. The values are static, set with specific values, and therefore can be copy and pasted directly from another source into a webpage.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "https://www.hooray-seo.com/fulfillment/schema#WebPage",
"url": "https://www.hooray-seo.com",
"name": "Hooray SEO Website"
}
</script>
Dynamic Schema
This method is how most modern-day CMSs allow schema markup to be generated (from templates/variables). Certain values are populated from data saved somewhere else in the website.
This allows schema code templates to re-used from page to page, product to product, event to events, etc without hard-coding schema markup for each one.
Templates are used to populate these variables, which when published to the web, create a resulting static schema.
const webpageURL = "https://www.hooray-seo.com/fulfillment/schema";
const websiteName = "Hooray SEO Website";
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "{{webpageURL}}#WebPage",
"url": "{{webpageURL}}",
"name": "{{websiteName}}"
}
</script>