-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
default.hbs
103 lines (92 loc) · 3.04 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
<!DOCTYPE html>
<html lang="{{@site.lang}}">
<head>
{{! Document Settings }}
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
{{! Page Meta }}
<title>{{meta_title}}</title>
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#5eb9d7" />
<link rel="shortcut icon" href="{{@site.icon}}" />
<link rel="stylesheet" href="https://use.typekit.net/pgr6fet.css">
{{^is "post"}}
<meta property="og:image" content="{{img_url @site.cover_image}}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:url" content="{{img_url @site.cover_image}}" />
{{/is}}
{{! Ghost outputs important style and meta data with this tag }}
{{ghost_head}}
</head>
<body class="{{body_class}}">
{{> nav/header}}
{{{body}}}
{{> footer/footer}}
{{> scripts}}
<script>
// Parse the URL parameter
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
// Give the parameter a variable name
var action = getParameterByName('action');
var stripe = getParameterByName('stripe');
$(document).ready(function () {
if (action == 'subscribe') {
$('body').addClass("subscribe-success");
}
if (action == 'signup') {
window.location = '{{@site.url}}/signup/?action=checkout';
}
if (action == 'checkout') {
$('body').addClass("signup-success");
}
if (action == 'signin') {
$('body').addClass("signin-success");
}
if (stripe == 'success') {
$('body').addClass("checkout-success");
}
if (stripe == 'billing-update-success') {
$('body').addClass("billing-success");
}
if (stripe == 'billing-update-cancel') {
$('body').addClass("billing-cancel");
}
$('.notification-close').click(function () {
$(this).parent().addClass('closed');
var uri = window.location.toString();
if (uri.indexOf("?") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("?"));
window.history.replaceState({}, document.title, clean_uri);
}
});
// Reset form on opening subscrion overlay
$('.subscribe-button').click(function() {
$('.subscribe-overlay form').removeClass();
$('.subscribe-email').val('');
});
// Account navigation menu
$('.account-menu-avatar').click(function(event) {
$(this).toggleClass('active');
event.stopPropagation();
});
$('.account-menu-dropdown').click(function(event) {
event.stopPropagation();
});
$('body').click(function () {
$('.account-menu-avatar').removeClass('active');
});
});
</script>
{{{block "scripts"}}}
{{ghost_foot}}
</body>
</html>