This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpost.php
81 lines (73 loc) · 3.45 KB
/
post.php
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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<!-- 文章页 -->
<div id="post">
<article class="post-card">
<p class="post-time">
<i class="fa fa-fw fa-clock-o"></i>
<time datetime="<?php $this->date('c'); ?>"><?php $this->date('Y年m月d日 H:i'); ?></time>
<span><i class="fa fa-fw fa-eye"></i><?php get_post_view($this) ?></span>
<span>分类: <?php $this->category(','); ?></span>
</p>
<h1 class="post-title" itemprop="name headline"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
<div id="post-toc" class="post-content markdown-body"><?php $this->content(); ?></div>
<p class="tags"><span>#</span><?php $this->tags(', ', true, 'none'); ?></p>
<ul class="post-meta clearfix">
<li><span>更新于: <?php echo date('Y年m月d日 H:i', $this->modified) ?></span></li>
</ul>
<?php if (!empty($this->options->labs) && in_array('showCopyright', $this->options->labs)) : ?>
<!-- 版权声明 -->
<section class="post-copyright">
<p class="author">作者: <?php $this->author(); ?></p>
<p class="link">链接: <a href="<?php $this->permalink(); ?>"><?php $this->permalink(); ?></a></p>
<p class="protocal">版权: 除特别声明,均采用<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0</a>许可协议,转载请表明出处</p>
</section>
<?php endif; ?>
</article>
<ul class="post-near clearfix">
<li><i class="fa fa-fw fa-angle-left"></i><?php $this->thePrev('%s', '无'); ?></li>
<li><?php $this->theNext('%s', '无'); ?><i class="fa fa-fw fa-angle-right"></i></li>
</ul>
<div id="contentTree" class="contentTree-a">
<span class="asideOpe"><i class="fa fa-angle-double-left"></i></span>
<p>目录<span>Content</span></p>
<div id="toc"></div>
</div>
<!-- 蒙版 -->
<div class="aside-mask"></div>
<?php $this->need('comments.php'); ?>
</div><!-- end #app-->
<?php $this->need('footer.php'); ?>
<script type="text/javascript">
// toc
new Toc('post-toc', {
'level': 2,
'top': 200,
'class': 'toc',
'targetId': 'toc'
}, function() {
$(".asideOpe").click(function() {
if (!$("#contentTree").hasClass("contentTree-a")) {
$(".aside-mask").removeClass("aside-mask-show");
$("#contentTree").addClass("contentTree-a");
$('i', this).attr('class', 'fa fa-angle-double-left')
} else {
$(".aside-mask").addClass("aside-mask-show");
$("#contentTree").removeClass("contentTree-a");
$('i', this).attr('class', 'fa fa-angle-double-right')
}
})
$(".aside-mask").click(function() {
if ($(this).hasClass("aside-mask-show")) {
$(this).removeClass("aside-mask-show")
$("#contentTree").addClass("contentTree-a");
$('.asideOpe i').attr('class', 'fa fa-angle-double-left')
}
})
// 文章图片
$("#post img").each(function() {
if ($(this).attr("title") !== "" && $(this).attr("title") !== "请输入图片描述")
$(this).after("<p style='text-align:center;margin:5px 0 0 0;'>" + $(this).attr("title") + "</p>")
})
});
</script>