-
Notifications
You must be signed in to change notification settings - Fork 60
/
post.php
145 lines (129 loc) · 4.63 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
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
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('layout/_partial/head.php');
?>
<style>
.nexmoe-valign {
display: -webkit-box !important;
display: -webkit-flex !important;
display: -ms-flexbox !important;
display: flex !important;
-webkit-box-align: center !important;
-webkit-align-items: center !important;
-ms-flex-align: center !important;
align-items: center !important;
height: 100%;
}
.mdui-tab-indicator {
display: none;
}
.mdui-tab .mdui-tab-active {
color: #fff;
background: #f4a7b9;
opacity: 1;
}
.nexmoe-post-right .nexmoe-toc {
margin-left: 16px;
width: 240px;
margin-left: 0px;
text-align: left;
}
.nexmoe-post-right .nexmoe-toc > ol {
padding-left: 0;
}
.nexmoe-post-right .nexmoe-fixed {
position: fixed;
z-index: 1000;
height: 100vh;
display: inline-block;
top: 0;
}
.nexmoe-post-right {
margin: 0 -25px;
text-align: right;
}
.nexmoe-post-right .nexmoe-toc li {
margin: 1em 0;
}
.nexmoe-toc a {
color: rgba(0, 0, 0, .6);
}
.nexmoe-toc * {
list-style-type: decimal;
color: rgba(0, 0, 0, .6);
}
.hljs {
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}
</style>
<link rel="stylesheet" href="<?php echo $this->options->highlight_css ?>">
<link rel="stylesheet" href="<?php echo $this->options->fancybox_css ?>">
<body class="mdui-drawer-body-left">
<?php $this->need('layout/_partial/background.php'); ?>
<div id="nexmoe-header">
<?php $this->need('layout/_partial/header.php'); ?>
</div>
<div id="nexmoe-content">
<div class="nexmoe-primary">
<div class="nexmoe-post">
<div class="nexmoe-post-cover mdui-ripple">
<?php if ($this->fields->Cover) { ?>
<img src="<?php echo $this->fields->Cover ?>">
<?php } else { ?>
<img src="<?php echo $this->options->background ?>">
<?php } ?>
<h1><?php $this->title() ?></h1>
</div>
<div class="nexmoe-post-meta">
<a><i class="nexmoefont icon-calendar-fill"></i><?php $this->date('Y年n月d日'); ?></a>
<a><?php artCount($this->cid); ?> 汉字</a>
<a><?php post_view($this); ?> 围观</a>
<a><?php $this->commentsNum('%d'); ?> 评论</a>
<?php $this->category(','); ?>
<?php $this->tags(' ', true); ?>
</div>
<article>
<?php
$content = preg_replace('#<h(.*?)>(.*?)</h(.*?)>#', '<h$1 id="$2">$2</h$3>', $this->content);
echo $content;
?>
</article>
<div class="nexmoe-post-right">
<div class="nexmoe-fixed">
<div class="nexmoe-valign">
<div class="nexmoe-toc">
<ol class="toc"><?php getCatalog(); ?></ol>
</div>
</div>
</div>
</div>
<div id="comments">
<?php $this->need('comments.php'); ?>
</div>
</div>
</div>
</div>
<?php $this->need('layout/_partial/after-footer.php'); ?>
<?php if (!empty($this->options->function) && in_array('fancybox', $this->options->function)): ?>
<script src="<?php echo $this->options->fancybox_js ?>"></script>
<?php endif; ?>
<?php if (!empty($this->options->function) && in_array('enableMathjax', $this->options->function)): ?>
<?php if ($this->fields->math != "No"): ?>
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>'
<script type="text/javascript"
src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<?php endif; ?>
<?php endif; ?>
<?php if (empty($this->options->function) || !in_array('enableMathjax', $this->options->function)): ?>
<?php if ($this->fields->math == "Yes"): ?>
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>'
<script type="text/javascript"
src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<?php endif; ?>
<?php endif; ?>
<script src="<?php echo $this->options->highlight_js ?>"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>