-
Notifications
You must be signed in to change notification settings - Fork 40
/
header.liquid
131 lines (120 loc) · 3.07 KB
/
header.liquid
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{%- comment -%}
This is a required section for the Shopify Theme Store.
It is available in the "Header" section in the theme editor.
Theme Store required settings
- Show announcement
- Text: message to announce
- Link: link of the announcement bar
Theme Store optional settings
- Home page only: only shows on the home page
{%- endcomment -%}
<section data-section-id="{{ section.id }}" data-section-type="header">
<header>
{% include 'navbar' %}
</header>
</section>
{% if section.settings.logo != blank %}
<style>
.logo-image {
display: block;
max-width: {{ section.settings.logo_max_width }}px;
}
</style>
{% endif %}
{% schema %}
{
"name": "Header",
"settings": [
{
"type": "header",
"content": "Announcement bar"
},
{
"type": "checkbox",
"id": "announcement_bar_enabled",
"label": "Show announcement",
"default": false
},
{
"type": "checkbox",
"id": "announcement_bar_home_page_only",
"label": "Show on home page only",
"default": true
},
{
"type": "text",
"id": "announcement_bar_text",
"label": "Announcement text",
"default": "Announce something here"
},
{
"type": "url",
"id": "announcement_bar_link",
"label": "Announcement link",
"info": "Optional"
},
{
"type": "header",
"content": "Header"
},
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 20,
"max": 200,
"step": 2,
"unit": "px",
"label": "Custom logo width",
"default": 100
},
{
"type": "link_list",
"id": "menu",
"label": "Menu",
"default": "main-menu"
}
]
}
{% endschema %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "{{ shop.name }}",
{% if section.settings.logo %}
{% assign image_size = section.settings.logo.width | append:'x' %}
"logo": "https:{{ section.settings.logo | img_url: image_size }}",
{% endif %}
"sameAs": [
"{{ settings.social_twitter_link }}",
"{{ settings.social_facebook_link }}",
"{{ settings.social_pinterest_link }}",
"{{ settings.social_instagram_link }}",
"{{ settings.social_tumblr_link }}",
"{{ settings.social_snapchat_link }}",
"{{ settings.social_youtube_link }}",
"{{ settings.social_vimeo_link }}"
],
"url": "{{ shop.url }}{{ page.url }}"
}
</script>
{% if template.name == 'index' %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "{{ shop.name }}",
"potentialAction": {
"@type": "SearchAction",
"target": "{{ shop.url }}/search?q={search_term_string}",
"query-input": "required name=search_term_string"
},
"url": "{{ shop.url }}{{ page.url }}"
}
</script>
{% endif %}