-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.hbs
105 lines (92 loc) · 3.82 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
<!DOCTYPE html>
<html lang="{{@site.locale}}">
<head>
{{! Document Settings }}
<meta charset="utf-8" />
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{! Makes IE support useful HTML5/CSS3 features }}
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
{{! Page Meta }}
<title>{{meta_title}}{{#is "post, page"}} — {{@site.title}}{{/is}}</title>
{{! Styles }}
<link rel="preconnect" href="https://fonts.macpaw.com" crossorigin>
<link rel="stylesheet" href="https://fonts.macpaw.com/css?family=FixelText:300;400;500;600;700">
<script src="https://unpkg.com/lucide@latest"></script>
<link rel="stylesheet" type="text/css" href="{{asset "css/main.css"}}" />
{{! Ghost outputs important stuff with this tag }}
{{ghost_head}}
</head>
<body class="{{body_class}} has-{{#match @custom.header_font "Elegant serif"}}serif{{else match @custom.header_font "Modern sans-serif"}}sans{{else}}mono{{/match}}-header has-{{#match @custom.text_font "Elegant serif"}}serif{{else match @custom.text_font "Modern sans-serif"}}sans{{else}}mono{{/match}}-text" id="body">
{{! Everything else gets inserted here }}
<div id="app">
{{{body}}}
</div>
{{! Site Footer }}
{{> footer}}
{{!-- Scripts for Members subscription --}}
<script>
// Code for members notifications
// 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.addEventListener("DOMContentLoaded", function(event) {
// These classes can be used to show success notifications for each action.
{{!-- Scripts for Members subscription --}}
var notifications = document.getElementById("notifications");
notifications.onclick = function(e){
notifications.hidden = true;
notifications.style.display = "none";
}
if (action == 'subscribe') {
document.body.classList.add("subscribe-success");
notifications.innerHTML = "You've successfully subscribed to {{@site.title}}";
}
if (action == 'signup') {
window.location = '{{@site.url}}/signup/?action=checkout';
}
if (action == 'checkout') {
document.body.classList.add("signup-success");
notifications.innerHTML = "Great! Next, complete checkout for full access to {{@site.title}}";
}
if (action == 'signin') {
document.body.classList.add("signin-success");
notifications.innerHTML = "Welcome back! You've successfully signed in.";
}
if (stripe == 'success') {
document.body.classList.add("checkout-success");
notifications.innerHTML = "Success! Your account is fully activated, you now have access to all content.";
}
if (stripe == 'billing-update-success') {
document.body.classList.add("billing-success");
notifications.innerHTML = "Success! Your billing info is updated.";
}
if (stripe == 'billing-update-cancel') {
document.body.classList.add("billing-cancel");
notifications.innerHTML = "Billing info update failed."
}
if (action || stripe) {
notifications.hidden = false;
notifications.style.display = "block";
URLSearchParams.delete(action);
URLSearchParams.delete(stripe);
}
});
</script>
<script>
lucide.createIcons();
</script>
{{! Ghost outputs important scripts with this, including the the content for the code injection pane }}
{{ghost_foot}}
</body>
</html>