SEO enhancements + structured data

master
Mark Moffat 2020-01-23 22:33:21 +10:30
parent 6141a41f16
commit 4ef5e48d1c
3 changed files with 46 additions and 2 deletions

View File

@ -71,6 +71,10 @@
"type": "string",
"default": "£"
},
"currencyISO": {
"type": "string",
"default": "USD"
},
"paymentGateway": {
"type": "string",
"enum": ["paypal", "stripe", "authorizenet", "adyen", "instore"]
@ -113,6 +117,12 @@
"maxQuantity": {
"type": "number"
},
"twitterHandle": {
"type": "string"
},
"facebookAppId": {
"type": "string"
},
"modules": {
"type": "object",
"properties": {

View File

@ -26,6 +26,8 @@
"availableLanguages": ["en", "it"],
"defaultLocale": "en",
"maxQuantity": 25,
"twitterHandle": "",
"facebookAppId": "",
"modules": {
"enabled": {
"shipping": "shipping-basic",

View File

@ -65,6 +65,9 @@
<link rel="canonical" href="{{config.baseUrl}}" />
{{/if}}
<meta name="referrer" content="origin" />
{{#if @root.config.facebookAppId}}
<meta property="fb:app_id" content="{{@root.config.facebookAppId}}" />
{{/if}}
<meta property="og:site_name" content="{{config.cartTitle}}" />
{{#if result.productTitle}}
<meta property="og:type" content="product" />
@ -89,6 +92,9 @@
<meta property="og:description" content="{{snip config.cartDescription}}">
{{/if}}
{{/if}}
{{#if @root.config.twitterHandle}}
<meta property="twitter:site" content="{{@root.config.twitterHandle}}">
{{/if}}
{{#if result.productTitle}}
<meta property="twitter:card" content="product" />
{{else}}
@ -102,12 +108,38 @@
{{/if}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"@context": "https://schema.org/",
{{#if result.productTitle}}
"@type": "Product",
"name": "{{result.productTitle}}",
"offers": {
"price": "{{result.productPrice}}",
"priceCurrency": "{{config.currencyISO}}",
"description": "{{snip productDescription}}",
"sku": "{{result._id}}",
"url": "{{pageUrl}}"
},
{{else}}
"publisher": "{{config.cartTitle}}",
"@type": "WebSite",
{{/if}}
{{#if result.productImage}}
"image": "{{config.baseUrl}}{{result.productImage}}",
{{/if}}
{{#if productDescription}}
"description": "{{snip productDescription}}",
{{/if}}
{{#if result.productTitle}}
"sku": "{{result._id}}",
{{/if}}
{{#if pageUrl}}
"url": "{{pageUrl}}"
{{else}}
"url": "{{config.baseUrl}}"
{{/if}}
}
</script>
<!-- SEO data -->
{{~#if config.googleAnalytics}}{{{config.googleAnalytics}}}{{/if}}
{{~#if config.customCss}}<style>{{{config.customCss}}}</style>{{/if}}