-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathindex.php
92 lines (84 loc) · 4.69 KB
/
index.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
<?php
/**
* VOID:无类型
*
* 作者:<a href="https://www.imalan.cn">熊猫小A</a>
*
* @package Typecho-Theme-VOID
* @author 熊猫小A
* @version 2.1.2
* @link https://blog.imalan.cn/archives/247/
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$setting = $GLOBALS['VOIDSetting'];
if(!Utils::isPjax()){
$this->need('includes/head.php');
$this->need('includes/header.php');
}
?>
<main id="pjax-container">
<title hidden>
<?php Contents::title($this); ?>
</title>
<?php $this->need('includes/banner.php'); ?>
<div class="wrapper container">
<section id="index-list">
<ul>
<?php while($this->next()): ?>
<li>
<article class="yue <?php if($this->fields->banner != '' && $this->fields->bannerascover != '0') echo 'has-banner'; ?>" itemscope itemtype="http://schema.org/Article">
<?php if($this->fields->banner != '' && $this->fields->bannerascover != '0'): ?>
<a href="<?php $this->permalink(); ?>" class="banner" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="<?php echo $this->fields->banner;?>">
<meta itemprop="url" content="<?php echo $this->fields->banner; ?>">
</a>
<?php else: ?>
<div hidden itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="<?php if($this->fields->banner != '') echo $this->fields->banner; else Utils::gravatar($this->author->mail, 200); ?>">
</div>
<?php endif; ?>
<div class="content-wrap">
<a class="title" href="<?php $this->permalink(); ?>">
<h1 itemprop="name" data-words="<?php echo Utils::wordCount($this); ?>"><?php $this->title(); ?></h1>
</a>
<?php if($this->fields->excerpt != '') echo "<p itemprop=\"headline\" class=\"headline content\">{$this->fields->excerpt}</p>"; ?>
<div itemprop="articleBody">
<?php if($this->fields->showfullcontent != '1'): ?>
<?php if($this->fields->excerpt == ''): ?>
<p itemprop="headline"><?php if(Utils::isMobile()) $this->excerpt(60); else $this->excerpt(100); ?></p>
<?php endif; ?>
<?php else: ?>
<?php $this->content(); ?>
<?php endif; ?>
</div>
<div class="post-meta-index">
Posted by <span itemprop="author"><?php $this->author(); ?></span> on <time datetime="<?php echo date('c', $this->created); ?>" itemprop="datePublished"><?php echo date('Y-m-d', $this->created); ?></time>
<?php
if($this->fields->showfullcontent == '1')
echo ' • <a href="'.$this->permalink.'#comments">参与讨论 →</a>';
else
echo ' • <a href="'.$this->permalink.'">阅读全文 →</a>';
?>
</div>
<meta itemprop="dateModified" content="<?php echo date('c', $this->modified); ?>">
<meta itemscope itemprop="mainEntityOfPage" itemtype="https://schema.org/WebPage" itemid="<?php $this->permalink(); ?>">
<div hidden itemprop="publisher" itemscope="" itemtype="https://schema.org/Organization">
<meta itemprop="name" content="<?php $this->options->title(); ?>">
<div itemprop="logo" itemscope="" itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="<?php Utils::gravatar($this->author->mail, 200); ?>">
</div>
</div>
</div>
</article>
</li>
<?php endwhile; ?>
</ul>
</section>
<?php $this->pageNav('<span aria-label="上一页">←</span>', '<span aria-label="下一页">→</span>', 1, '...', 'wrapClass=pager&prevClass=prev&nextClass=next'); ?>
</div>
</main>
<?php
if(!Utils::isPjax()){
$this->need('includes/footer.php');
}
?>