-
Notifications
You must be signed in to change notification settings - Fork 10
/
microdata_templates.go
55 lines (51 loc) · 1.65 KB
/
microdata_templates.go
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
54
55
package seo
// MicroProductTemplate a bundle of microdata templates
var (
MicroProductTemplate = `
<div itemscope itemtype="http://schema.org/Product" style="display:none;">
<span itemprop="brand">{{.BrandName}}</span>
<span itemprop="name">{{.Name}}</span>
<img itemprop="image" src="{{.Image}}" />
<span itemprop="description">{{.Description}}</span>
<span itemprop="sku">{{.SKU}}</span>
<span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">{{.RatingValue}}</span> <span itemprop="reviewCount">{{.ReviewCount}}</span>
</span>
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="USD" />
<span itemprop="price">{{.Price}}</span>
<time itemprop="priceValidUntil" datetime="{{.PriceValidUntil}}"></time>
<span itemprop="seller">{{.SellerName}}</span>
<link itemprop="itemCondition" href="http://schema.org/UsedCondition"/>
<link itemprop="availability" href="http://schema.org/InStock"/>
</span>
</span>
</div>
`
MicroContactTemplate = `
<script type="application/ld+json">
{ "@context" : "http://schema.org",
"@type" : "Organization",
"url" : "{{.URL}}",
"contactPoint" : [
{ "@type" : "ContactPoint",
"telephone" : "{{.Telephone}}",
"contactType" : "{{.ContactType}}"
} ] }
</script>
`
MicroSearchTemplate = `
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{.URL}}",
"potentialAction": {
"@type": "SearchAction",
"target": "{{.Target}}",
"query-input": "{{.FormattedQueryInput}}"
}
}
</script>
`
)