-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost.php
101 lines (98 loc) · 4.76 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<?php $imgrand = rand(); ?>
<header class="inner-header">
<div class="inner-header__main">
<figure class="post-thumb">
<div class="post-loading lazy-load-placeholder">
<div class="post-loading__1"></div>
<div class="post-loading__2"></div>
<div class="post-loading__3"></div>
</div>
<img src="<?php $this->options->themeUrl('img/default_thumb.jpg'); ?>"
<?php if(Service::get_postthumb($this)): ?>
data-src="<?php echo Service::get_postthumb($this) ?>"
<?php elseif($this->options->postImgUrl): ?>
data-src="<?php echo $this->options->postImgUrl ?>?rand=<?php echo $imgrand;?>"
<?php else: ?>
data-src="<?php $this->options->themeUrl('img/default_thumb.jpg'); ?>"
<?php endif; ?>
class="lazy-load">
</figure>
<div class="post-info">
<h1 class="post-info__title"><?php $this->title() ?></h1>
<div class="post-info__meta">
<div class="post-info__meta--author">
<?php if($this->options->logoUrl): ?>
<img class="author-avatar" src="<?php $this->options->logoUrl() ?>">
<?php else: ?>
<img class="author-avatar" src="<?php $this->options->themeUrl('/img/default_avatar.jpg');?>">
<?php endif; ?>
<a class="author-name" href="<?php $this->author->permalink(); ?>"><?php $this->author() ?></a>
</div>
<div class="post-info__meta--time">
<i class="iconfont icon-clock"></i>
<time datetime="<?php $this->date('c'); ?>"><?php $this->date('Y年m月d日'); ?></time>
</div>
</div>
</div>
</div>
<?php if(Service::get_postthumb($this)): ?>
<div class="inner-header__bg top-bg" style="background-image:url(<?php echo Service::get_postthumb($this) ?>)">
<?php elseif($this->options->postImgUrl): ?>
<div class="inner-header__bg top-bg" style="background-image:url(<?php echo $this->options->postImgUrl; ?>?rand=<?php echo $imgrand;?>)">
<?php else: ?>
<div class="inner-header__bg top-bg" style="background-image:url(<?php $this->options->themeUrl('/img/default_thumb.jpg'); ?>)">
<?php endif; ?>
</div>
<div class="inner-header__waves top-waves">
<svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(252,252,252,0.7" />
<use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(252,252,252,0.5)" />
<use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(252,252,252,0.3)" />
<use xlink:href="#gentle-wave" x="48" y="7" fill="rgb(252,252,252)" />
</g>
</svg>
</div>
</header>
<section class="post">
<div class="post__wrap">
<div id="post-nav" class="post-menu"></div>
<div class="post-main">
<div class="post-main__tags">
<?php foreach($this->categories as $cat): ?>
<a href="<?php echo $cat["permalink"]?>" class="post-tag-cat tag-warning">
<i class="iconfont icon-folder"></i>
<span><?php echo $cat["name"] ?></span>
</a>
<?php endforeach; ?>
<?php foreach($this->tags as $tag): ?>
<a href="<?php echo $tag["permalink"]?>" class="post-tag-tag tag-success">
<i class="iconfont icon-tag"></i>
<span><?php echo $tag["name"] ?></span>
</a>
<?php endforeach; ?>
</div>
<div id="post-main-section" class="article-content line-numbers">
<?php echo Service::set_lazyload($this->content); ?>
</div>
<ul class="post-near">
<li>
<i class="iconfont icon-angle-left"></i>
<?php $this->theNext('%s','没有了'); ?>
</li>
<li>
<?php $this->thePrev('%s','没有了'); ?>
<i class="iconfont icon-angle-right"></i>
</li>
</ul>
<?php $this->need('comments.php'); ?>
</div>
</div>
</section>
<?php $this->need('footer.php'); ?>