-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpost.hbs
62 lines (62 loc) · 2.13 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
{{!< default}}
<link rel="stylesheet" href="{{asset "css/post.css"}}">
{{#post}}
<article class="{{post_class}}">
{{#if feature_image}}
<div class="post-image" style="background-image:url({{img_url feature_image}})">
<div class="post-image-header">
<div class="post-image-info">
<h1 class="post-image-title">{{title}}</h1>
<section class="post-meta post-image-meta">
<time datetime="{{date format='YYYY-MM-DD'}}">
{{date format="MMMM DD, YYYY"}}
</time>
{{tags separator=""}}
</section>
</div>
</div>
</div>
{{else}}
<div class="post-container" style="padding-bottom:0">
<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="MMMM DD, YYYY"}}
</time>
{{tags separator=""}}
</section>
</header>
</div>
{{/if}}
<div class="post-container" style="padding-top:0">
<hr class="post-hr">
<section class="post-content">
{{content}}
<hr class="post-hr">
</section>
<script>
window.onload = function(){
//为post的每张图片添加属性以支持点击放大
var post_imgs = $(".post-content img")
for (var i = post_imgs.length - 1; i >= 0; i--) {
post_imgs[i].setAttribute("data-action", "zoom")
}
}
</script>
</div>
</article>
{{/post}}
{{!-- <div id="comment"></div>
<script src="https://cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js'></script>
<script>
new Valine({
el: '#comment',
verify: false,
appId: 'APP_ID',
appKey: 'APP_KEY',
placeholder: '想说点什么?',
avatar: 'mm'
});
</script> --}}