forked from TryGhost/London
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.hbs
158 lines (140 loc) · 5.54 KB
/
default.hbs
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
<!DOCTYPE html>
<html lang="{{@site.lang}}">
<head>
{{!-- Document Settings --}}
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
{{!-- Base Meta --}}
<title>{{meta_title}}</title>
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{!-- Styles'n'Scripts --}}
<link rel="stylesheet" type="text/css" href="{{asset "built/screen.css"}}" />
{{!-- This tag outputs SEO meta+structured data and other important settings --}}
{{ghost_head}}
</head>
<body class="{{body_class}}">
<div class="site-wrapper">
<header class="site-head">
<div class="site-head-container">
<a class="nav-burger" href="#">
<div class="hamburger hamburger--collapse" aria-label="Menu" role="button" aria-controls="navigation">
<div class="hamburger-box">
<div class="hamburger-inner"></div>
</div>
</div>
</a>
<div id="swup" class="site-head-left">
{{#if @site.logo}}
<a class="site-head-logo" href="{{@site.url}}"><img src="{{@site.logo}}" alt="{{@site.title}}" /></a>
{{else}}
<a class="site-head-logo" href="{{@site.url}}">{{@site.title}}</a>
{{/if}}
</div>
<nav class="site-head-center">
{{navigation}}
</nav>
<div class="site-head-right">
<div class="social-links">
{{#if @site.facebook}}
<a href="{{facebook_url @site.facebook}}" title="Facebook" target="_blank" rel="noopener">Facebook</a>
{{/if}}
{{#if @site.twitter}}
<a href="{{twitter_url @site.twitter}}" title="Twitter" target="_blank" rel="noopener">Twitter</a>
<a href="https://feedly.com/i/subscription/feed/{{@site.url}}/rss/" title="RSS" target="_blank" rel="noopener">RSS</a>
{{/if}}
{{>search-icon}}
</div>
</div>
</div>
</header>
<main id="site-main" class="site-main">
<div id="swup" class="transition-fade">
{{!-- All the main content gets inserted here, index.hbs, post.hbs, etc --}}
{{{body}}}
</div>
</main>
{{!-- The footer at the very bottom of the screen --}}
<footer class="site-foot">
© {{date format="YYYY"}} <a href="{{@site.url}}">{{@site.title}}</a>
</footer>
</div>
{{>search}}
{{!-- The big email subscribe modal content --}}
{{#if @labs.subscribers}}
<div id="subscribe" class="subscribe-overlay">
<a class="subscribe-overlay-close" href="#"></a>
<div class="subscribe-overlay-content">
{{#if @site.logo}}
<img class="subscribe-overlay-logo" src="{{@site.logo}}" alt="{{@site.title}}" />
{{/if}}
<h1 class="subscribe-overlay-title">Subscribe to {{@site.title}}</h1>
<p class="subscribe-overlay-description">Stay up to date! Get all the latest & greatest posts delivered straight to your inbox</p>
{{subscribe_form placeholder="youremail@example.com"}}
</div>
</div>
{{/if}}
<script src="{{asset "built/global.js"}}"></script>
<script src="{{asset "built/swup.js"}}" data-swup-ignore-script></script>
<script src="{{asset "built/infinitescroll.js"}}" data-swup-ignore-script></script>
<script src="{{asset "built/glider.min.js"}}" data-swup-ignore-script></script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous">
</script>
{{!-- Handle swup content replacement --}}
<script data-swup-ignore-script>
$(document).ready(function () {
setColorHex(document)
// Mobile Menu Trigger
$('.nav-burger').click(function () {
$('body').toggleClass('site-head-open')
})
})
// Initiate Swup transitions
var swup = new Swup({
plugins: [new SwupHeadPlugin(), new SwupScriptsPlugin()]
})
document.addEventListener('swup:contentReplaced', event => {
initInfiniteScroll(window, document)
setColorHex(document)
// Re-fire glider when back to home event triggered via swup. Fuck swup.
if(document.querySelector('.index-news-post')) {
new Glider(document.querySelector('.index-news-post'), {
slidesToShow: 1,
dots: '.dots',
rewind: true,
draggable: true,
arrows: {
prev: '.glider-prev',
next: '.glider-next'
}
})
};
window.scrollTo({ top: 0, behavior: 'smooth' })
$('body').removeClass('site-head-open')
$('body').removeClass('search-opened')
$('body').attr('class', function (i, c) {
return c.replace(/(^|\s)tag-\S+/g, '')
})
})
</script>
{{#is "home"}}
<script data-swup-ignore-script>
// Initiate glider for news post on front-page
new Glider(document.querySelector('.index-news-post'), {
slidesToShow: 1,
dots: '.dots',
rewind: true,
draggable: true,
arrows: {
prev: '.glider-prev',
next: '.glider-next'
}
});
</script>
{{/is}}
{{{block "scripts"}}}
</body>
</html>