-
Notifications
You must be signed in to change notification settings - Fork 3
/
social-tags.html
53 lines (52 loc) · 4.51 KB
/
social-tags.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!--
Web Site Advantage: Advanced Social Meta Tags [v2.1]
https://bigcommerce.websiteadvantage.com.au/rich-snippets/articles/advanced-social-meta-tags-for-bigcommerce/
Copyright (C) 2020 Web Site Advantage
-->
{{~!-- Variable Definitions Start --}}
{{!-- Variable Definitions End --}}
{{~#if settings.request.absolute_path '===' '/'}}
<meta property="og:url" content="{{settings.base_url}}{{settings.request.absolute_path}}">
<meta property="og:type" content="website">
<meta property="og:title" content={{{json head.title}}}>
{{~#if (getVar "homepage:og:description")}}<meta property="og:description" content={{#replace "\r\n" (json (ellipsis (sanitize (getVar "homepage:og:description")) 255))}} {{else}}{{{json (ellipsis (sanitize (getVar "homepage:og:description")) 255)}}}{{/replace}}>{{~/if}}
{{~#if settings.store_logo.image}}<meta property="og:image" content="{{getImage settings.store_logo.image}}">{{~/if}}
{{~else if page_type '===' 'category'}}
<meta property="og:url" content="{{category.url}}">
<meta property="og:type" content="website">
<meta property="og:title" content={{{json category.name}}}>
<meta property="og:description" content={{#replace "\r\n" (json (ellipsis (sanitize category.description) 255))}} {{else}}{{{json (ellipsis (sanitize category.description) 255)}}}{{/replace}}>
{{~#if category.image}}<meta property="og:image" content="{{getImage category.image}}">{{~/if}}
{{~else if page_type '===' 'brand'}}
<meta property="og:url" content="{{brand.url}}">
<meta property="og:type" content="website">
<meta property="og:title" content={{{json brand.name}}}>
{{~#if brand.image}}<meta property="og:image" content="{{getImage brand.image}}">{{~/if}}
{{~else if page_type '===' 'blog_post'}}
<meta property="og:url" content="{{blog.post.url}}">
<meta property="og:type" content="article">
<meta property="og:title" content={{{json blog.post.title}}}>
{{~#if blog.post.thumbnail}}<meta property="og:image" content="{{getImage blog.post.thumbnail}}">{{~/if}}
{{~#if blog.post.author}}<meta property="article:author" content={{{json blog.post.author}}}>{{~/if}}
<meta property="article:published_time" content="{{~#if (moment blog.post.date_published format="YYYY-MM-DD") '===' 'Invalid date'}}{{blog.post.date_published}}{{else}}{{moment blog.post.date_published format="YYYY-MM-DD"}}{{~/if}}">
{{~else if page_type '===' 'product'}}
{{~#if product.brand.name}}<meta property="og:brand" content={{{json product.brand.name}}}/>{{~/if}}
<meta property="og:availability" content="{{~#if product.pre_order}}available for order{{~else if product.out_of_stock '===' true}}out of stock{{~else if product.out_of_stock_message}}out of stock{{~else if product.can_purchase '===' false}}out of stock{{~else}}in stock{{~/if}}">
<meta property="product:availability" content="{{~#if product.pre_order}}available for order{{~else if product.out_of_stock '===' true}}out of stock{{~else if product.out_of_stock_message}}out of stock{{~else if product.can_purchase '===' false}}out of stock{{~else}}in stock{{~/if}}">
<meta property="product:condition" content="{{#if product.condition}}{{lowercase product.condition}}{{else}}new{{/if}}">
{{#if theme_settings.restrict_to_login '!==' true}}
<meta property="product:price:amount" content="{{~#if product.price.with_tax.value}}{{product.price.with_tax.value}}{{~else}}{{product.price.without_tax.value}}{{~/if}}">
{{~#or product.price.rrp_with_tax.value product.price.rrp_without_tax.value}}<meta property="og:price:standard_amount" content="{{~#if product.price.rrp_with_tax.value}}{{product.price.rrp_with_tax.value}}{{~else}}{{product.price.rrp_without_tax.value}}{{~/if}}">{{~/or}}
<meta property="product:price:currency" content="{{currency_selector.active_currency_code}}">
{{~/if}}
{{~#if (getVar "product:retailer_item_id")}}<meta property="product:retailer_item_id" content={{{json (getVar "product:retailer_item_id")}}}>{{~/if}}
{{~#if (getVar "product:item_group_id")}}<meta property="product:item_group_id" content={{{json (getVar "product:item_group_id")}}}>{{~/if}}
{{~else}}
<meta property="og:type" content="article" />
{{~/if}}
{{~#if page_type '!==' 'product'}}<meta property="og:site_name" content={{{json settings.store_name}}}>{{~/if}}
{{~#if (getVar "fb:pages")}}<meta property="fb:pages" content="{{getVar "fb:pages"}}"/>{{~/if}}
<meta name="twitter:card" content="summary" />
{{~#if (getVar "twitter:site")}}<meta name="twitter:site" content="{{getVar "twitter:site"}}">{{~/if}}
{{~#if (getVar "twitter:creator")}}<meta name="twitter:creator" content="{{getVar "twitter:creator"}}">{{~/if}}
<!-- Advanced Social Meta Tags - END -->