-
Notifications
You must be signed in to change notification settings - Fork 7
/
base.njk
210 lines (168 loc) · 7.06 KB
/
base.njk
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffb218"/>
<link rel="shortcut icon" href="/assets/img/favicon.png" type="image/vnd.microsoft.icon" />
{# ---- Optimal/non-blocking way to load Google Font (https://csswizardry.com/2020/05/the-fastest-google-fonts) ---- #}
{% if website.google_font_url %}
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
{# Less optimized method but less FOUT: #}
<link rel="stylesheet" href="{{ website.google_font_url }}" />
{# More optimized method but more FOUT: #}
{# <link rel="preload" as="style" href="{{ website.google_font_url }}" />
<link rel="stylesheet" href="{{ website.google_font_url }}" media="print" onload="this.media='all'" /> #}
{# Ignoring <noscript> for normal font load when Javascript is disabled. Fallback font will be used #}
{% endif %}
{# SEO... #}
<title>{{ title and title + " | " }}{{ website.title }}</title>
{% if business and business == "api" %}
{% set keywords_extra = ", " + website.keywords_api %}
{% elif business and business == "retail" %}
{% set keywords_extra = ", " + website.keywords_retail %}
{% else %}
{% set keywords_extra = "" %}
{% endif %}
<meta name="description" content="{{ (description or website.tag_line) | truncate(150) }}">
<meta name="keywords" content="{{ keywords or website.keywords }}{{ keywords_extra }}, {{ website.short_name }}">
{# OpenGraph (Facebook) Social Card #}
<meta property="og:title" content="{{ title and title + " | " }}{{ website.title }}">
<meta property="og:description" content="{{ description or website.tag_line }}">
<meta property="og:image" content="{{ env.BASE_URL }}{% SocialImagePath image or website.image %}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ env.BASE_URL }}{{ page.url }}">
<meta property="og:site_name" content="{{ website.title }}">
{# Twitter Social Card #}
<meta name="twitter:title" content="{{ title and title + " | " }}{{ website.title }}">
<meta name="twitter:description" content="{{ description or website.tag_line }}">
<meta name="twitter:image" content="{{ env.BASE_URL }}{% SocialImagePath image or website.image %}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="{{ env.BASE_URL }}{{ page.url }}">
<meta name="twitter:site" content="{{ website.twitter_handle }}">
{# RSS Atom Feed #}
<link rel="alternate" href="{{ env.BASE_URL }}/feed.xml" type="application/atom+xml"
title="Blog | {{ website.title }}">
{% block head %}{% endblock %}
{# DEFINE Main CSS Files (common to all sections & pages) #}
{% set css_main %}
{% include "css/flex.css" %}
{% include "css/base.css" %}
{% include "css/nav.css" %}
{% include "css/footer.css" %}
{% endset %}
{# DEFINE PureCSS.io Grid System CSS #}
{% set css_pure %}
{# read more: https://purecss.io #}
{% include "css/purecss/base-min.css" %}
{% include "css/purecss/grids-min.css" %}
{% include "css/purecss/grids-responsive-min.css" %}
{% endset %}
{# DEFINE CSS to debug components #}
{% set css_debug %}
{% include "css/debug.css" %}
{% endset %}
{# DEFINE CSS for Blog section (included in blog template and the blog listing pages) #}
{% set css_blog %}
{% include "css/blog.css" %}
{% endset %}
{# DEFINE CSS for University section #}
{% set css_university %}
{% include "css/university.css" %}
{% endset %}
{# DEFINE Main Javascript files #}
{% set js_main %}
{% include "js/base.js" %}
{% endset %}
{# ----- DEFINE EMBLA CAROUSEL SUPPORT (https://github.com/davidcetinkaya/embla-carousel) ------ #}
{% set js_carousel %}
{% include "js/embla-carousel.umd.min.js" %}
{% include "js/carousel.js" %}
{% endset %}
{% set css_carousel %}
{% include "css/carousel.css" %}
{% endset %}
<style>
{{ css_pure | cssmin | safe }}
{{ css_main | cssmin | safe }}
{% block custom_style %}{% endblock %}
</style>
{% if env.DEBUG_SECTIONS=='true' -%}
<style>{{ css_debug | cssmin | safe }}</style>
{%- endif %}
</head>
<body>
{% include "navigation.njk" %}
<main>
{% block main%}{% endblock %}
</main>
{% include "footer.njk" %}
{% set netlify_cms %}
{% include "js/netlify_cms.js" %}
{% endset %}
<script>
{{ js_main | jsmin | safe }}
{{ netlify_cms | jsmin | safe }}
</script>
{# ~~~~~~ Zoho SalesIQ ~~~~~~ #}
{% if env.ZOHO_SALESIQ %}
<script>
addLoadEvent(function(){
window.$zohosalesiqready = false;
window.$zoho=window.$zoho || {};
$zoho.salesiq = $zoho.salesiq || {widgetcode:"{{env.ZOHO_SALESIQ}}", values:{}, ready:function(){}};
$zoho.salesiq.ready=function(embedinfo){
if ($zohosalesiqready===false){ $zohosalesiqready = true; $zoho.salesiq.reset(); }
}
loadScript("https://salesiq.zoho.in/widget", "zsiqscript", null, true);
});
</script>
<div id='zsiqwidget'></div>
{% endif %}
{# ~~~~~ Zoho PageSense Analytics ~~~~~ #}
{% if env.ZOHO_PAGESENSE_URL %}
<script>addLoadEvent(function() { loadScript("{{env.ZOHO_PAGESENSE_URL}}", null, null, true); });</script>
{% endif %}
{# ~~~~~ Zoho CRM ZCGA Script ~~~~~ #}
{% if env.ZOHO_CRM_ZCGA_SCRIPT_URL %}
<script>addLoadEvent(function() {
loadScript("{{env.ZOHO_CRM_ZCGA_SCRIPT_URL}}", null, null, true);
loadScript("/assets/js/zoho_crm_utm_script.js", null, null, true);
});</script>
{% endif %}
{# ~~~~~~ Facebook Pixel ~~~~~~ #}
{% if env.FACEBOOK_PIXEL_ID %}
<script>
addLoadEvent(function(){
var f=window, n;
if(f.fbq)return;
n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];
loadScript("https://connect.facebook.net/en_US/fbevents.js", null, null, true);
fbq('init', '{{env.FACEBOOK_PIXEL_ID}}');
fbq('track', 'PageView');
});
</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id={{env.FACEBOOK_PIXEL_ID}}&ev=PageView&noscript=1"/></noscript>
{% endif %}
{# ~~~~~ Global site tag (gtag.js) - Google Analytics / Tag Manager ~~~~~ #}
{% if env.GA_KEY %}
{% set google %}
{% include "js/google_analytics.js" %}
{% endset %}
<script>
{{ google | jsmin | safe }}
googleAnalytics('{{ env.GA_KEY }}');
addLoadEvent(function() { loadScript("https://www.googletagmanager.com/gtag/js?id={{ env.GA_KEY }}", null, null, true); });
</script>
{% endif %}
{# ~~~~~ Microsoft Clarity (Analytics) ~~~~~ #}
{% if env.MS_CLARITY_TAG %}
<script>(function(c,l,a,r,i,t,y){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);})(window, document, "clarity", "script", "{{ env.MS_CLARITY_TAG }}");</script>
{% endif %}
{# ~~~~~~~~ custom script placeholder for other pages ~~~~~~~~ #}
<script>{% block custom_script %}{% endblock %}</script>
</body>
</html>