-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathdefault.hbs
119 lines (100 loc) · 3.94 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
<!DOCTYPE html>
<html>
<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" />
<link rel="shortcut icon" href="{{asset "favicon.ico"}}">
{{! Styles'n'Scripts }}
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:400,700,400italic,700italic|Open+Sans:400italic,700italic,700,400">
<link rel="stylesheet" type="text/css" href="{{asset "css/screen.css"}}" />
{{! Ghost outputs important style and meta data with this tag }}
{{ghost_head}}
</head>
<body class="{{body_class}} {{#is 'index, tag, author'}}user{{/is}} {{#is 'post'}}{{#unless post.image}}noimage{{/unless}}{{/is}}">
{{! Everything else gets inserted here }}
{{{body}}}
{{#if @site.logo}}
<a href="{{@site.url}}" id="blog_badge">
<span style="background-image: url('{{@site.logo}}');">{{@site.title}}</span>
</a>
{{/if}}
{{!--
<footer class="site-footer clearfix">
<section class="copyright"><a href="{{@site.url}}">{{@site.title}}</a> © {{date format="YYYY"}}</section>
<section class="poweredby">Proudly published with <a href="https://ghost.org">Ghost</a></section>
</footer>
--}}
<script>
{{#is 'post'}}
function get_text(el) {
ret = "";
var length = el.childNodes.length;
for(var i = 0; i < length; i++) {
var node = el.childNodes[i];
if(node.nodeType != 8) {
ret += node.nodeType != 1 ? node.nodeValue : get_text(node);
}
}
return ret;
}
function reading_time () {
var post_content = document.getElementById('js-post-content');
if (post_content) {
var words = get_text(post_content),
count = words.split(/\s+/).length,
read_time = Math.ceil((count / 150)),
read_time_node = document.createTextNode(read_time + ' min read');
document.getElementById('js-reading-time').appendChild(read_time_node);
}
}
{{/is}}
function no_schema_links () {
var links = document.querySelectorAll('.js-remove-domain-schema');
if (links) {
for (i = 0; i < links.length; ++i) {
var link = links[i],
text = link.innerHTML,
no_schema = text.replace(/.*?:\/\//g, "");
link.innerHTML = no_schema;
}
}
}
window.onload = function () {
no_schema_links();
{{#is 'post'}}
reading_time();
{{/is}}
}
</script>
{{! Ghost outputs important scripts and data with this tag }}
{{ghost_foot}}
{{#is 'post'}}
<script>
$(function(){
var share_modal = $("#share_modal"),
update_social_links = true;
$("#btn_share").click(function(){
var that = $(this);
share_modal.fadeIn(200);
return false;
});
share_modal.click(function(e){
if (e.target.className == "wrap" || e.target.id == "share_modal") {
share_modal.fadeOut(200);
}
return false;
});
share_modal.find("div.inner > header > a.close").click(function(){
share_modal.fadeOut(200);
return false;
});
});
</script>
{{/is}}
</body>
</html>