forked from TryGhost/Casper
-
Notifications
You must be signed in to change notification settings - Fork 11
/
post.hbs
177 lines (151 loc) · 6.75 KB
/
post.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{{!< default}}
<div class="eta"></div>
{{!-- The comment above "< default" means - insert everything in this file into
the {{{body}}} of the default.hbs template, containing the blog header/footer. --}}
{{!-- Everything inside the #post tags pulls data from the post --}}
{{#post}}
<header class="main-header post-head {{#if feature_image}}" style="background-image: url({{img_url feature_image}}){{else}}no-cover{{/if}}">
<nav class="main-nav {{#if feature_image}}overlay{{/if}} clearfix">
{{#if @blog.logo}}
<a class="blog-logo" href="{{@blog.url}}"><img src="{{@blog.logo}}" alt="{{@blog.title}}" /></a>
{{else}}
<a class="blog-logo" href="{{@blog.url}}"><img src="{{asset 'img/Home-icon.svg'}}" alt="{{@blog.title}}" /></a>
{{/if}}
{{#if @blog.navigation}}
<a class="menu-button icon-menu" href="#"><span class="word">Menu</span></a>
{{/if}}
</nav>
</header>
<main class="content" role="main">
<article class="{{post_class}}">
<header class="post-header">
<h1 class="post-title">{{title}}</h1>
<section class="post-meta">
<time class="post-date" datetime="{{date format="YYYY-MM-DD"}}">{{date format="DD MMMM YYYY"}}</time> {{tags prefix=" on "}}
</section>
</header>
<section class="post-content">
{{content}}
</section>
<footer class="post-footer">
{{!-- Everything inside the #author tags pulls data from the author --}}
{{#author}}
{{#if profile_image}}
<figure class="author-image">
<a class="img" href="{{url}}" style="background-image: url({{img_url profile_image}})"><span class="hidden">{{name}}'s Picture</span></a>
</figure>
{{/if}}
<section class="author">
<h4><a href="{{url}}">{{name}}</a></h4>
{{#if bio}}
<p>{{bio}}</p>
{{else}}
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
{{/if}}
<div class="author-meta">
{{#if location}}<span class="author-location icon-location">{{location}}</span>{{/if}}
{{#if website}}<span class="author-link icon-link"><a href="{{website}}">{{website}}</a></span>{{/if}}
</div>
</section>
{{/author}}
<section class="share">
<h4>Share this post</h4>
<a class="icon-twitter" href="https://twitter.com/intent/tweet?text={{encode title}}&url={{url absolute="true"}}"
onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
<span class="hidden">Twitter</span>
</a>
<a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}"
onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
<span class="hidden">Facebook</span>
</a>
<a class="icon-google-plus" href="https://plus.google.com/share?url={{url absolute="true"}}"
onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
<span class="hidden">Google+</span>
</a>
</section>
{{!-- Email subscribe form at the bottom of the page --}}
{{#if @labs.subscribers}}
<section class="gh-subscribe">
<h3 class="gh-subscribe-title">Subscribe to {{@blog.title}}</h3>
<p>Get the latest posts delivered right to your inbox.</p>
{{subscribe_form placeholder="Your email address"}}
<span class="gh-subscribe-rss">or subscribe <a href="http://cloud.feedly.com/#subscription/feed/{{@blog.url}}/rss/">via RSS</a> with Feedly!</span>
</section>
{{/if}}
</footer>
<aside class="post-comments">
<div class="disqusbox">
<div>
<p><strong>View or Post Comments</strong></p>
</div>
<div id="disqus_thread">
<form onsubmit="my.loadDisqus();return false;" class=formBlock>
<input class="disqusbut" type=submit value="Load Comments">
</form>
</div>
<script>
var my = my || {};
if(disqus_shortname != null){
var disqus_identifier = '{{comment_id}}';
my.loadDisqus = function() {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
};
} else {
console.error("You need to declare your 'disqus_shortname' variable on Ghost admin, in the Code Injection section. ie: 'var disqus_shortname = 'myshortname';");
}
</script>
<noscript>Please enable javascript to <a rel="nofollow" href="http://disqus.com/?ref_noscript">discus this page, powered by Disqus.</a></noscript>
<style scoped=scoped>
@media print{
.disqusbox{display:none}
}
</style>
</div>
</aside>
</article>
</main>
{{!-- Links to Previous/Next posts --}}
<aside class="read-next">
{{#next_post}}
<a class="read-next-story {{#if feature_image}}" style="background-image: url({{img_url feature_image}}){{else}}no-cover{{/if}}" href="{{url}}">
<section class="post">
<h2>{{title}}</h2>
<p>{{excerpt words="19"}}…</p>
</section>
</a>
{{/next_post}}
{{#prev_post}}
<a class="read-next-story prev {{#if feature_image}}" style="background-image: url({{img_url feature_image}}){{else}}no-cover{{/if}}" href="{{url}}">
<section class="post">
<h2>{{title}}</h2>
<p>{{excerpt words="19"}}…</p>
</section>
</a>
{{/prev_post}}
</aside>
{{/post}}
<script type="text/javascript" src="{{asset "js/readingtime.js"}}"></script>
<script type="text/javascript">
/* Analytics */
if(typeof ga_ua != "undefined"){
(function(g,h,o,s,t,z){g.GoogleAnalyticsObject=s;g[s]||(g[s]=
function(){(g[s].q=g[s].q||[]).push(arguments)});g[s].s=+new Date;
t=h.createElement(o);z=h.getElementsByTagName(o)[0];
t.src='//www.google-analytics.com/analytics.js';
z.parentNode.insertBefore(t,z)}(window,document,'script','ga'));
ga('create',ga_ua);ga('send','pageview');
}
/* Disqus comment count */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
/* Reading time */
$('.post-content').readingTime({lang: "en", appendTimeString: " read"});
</script>