forked from Innei/Typecho-Theme-Paul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
executable file
·52 lines (50 loc) · 1.8 KB
/
page.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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
$this->need('header.php');
require_once 'functions.php';
$this->widget('Widget_Contents_Page_List')->to($pages);
global $index_about, $index_donate, $index_dream, $index_works;
while ($pages->next()):
switch ($pages->slug) {
case 'about':
$index_about = $pages->permalink;
break;
case 'donate':
$index_donate = $pages->permalink;
break;
case 'dream':
$index_dream = $pages->permalink;
break;
case 'project':
$index_works = $pages->text;
break;
case 'note':
$index_note = $pages->permalink;
break;
default:
break;
}
endwhile;
?>
<main class="is-article">
<nav class="navigation">
<a href="<?php $this->options->siteUrl(); ?>">首页</a>
<?php if ($index_about): ?><a href="<?php echo $index_about ?>">关于</a><?php endif ?>
<?php if ($index_donate): ?><a href="<?php echo $index_donate ?>">赞助</a> <?php endif; ?>
<?php if ($index_dream): ?><a href="<?php echo $index_dream ?>">心愿</a> <?php endif; ?>
</nav>
<article>
<h1><?php $this->title() ?></h1>
<?php $this->content() ?>
<div class="paul-note">
<div class="note-action">
<span class="comment" data-cid="<?php $this->cid(); ?>" data-year="<?php $this->year(); ?>"
title="参与评论">评论</span>
</div>
</div>
</article>
<?php $this->need('comments.php') ?>
<script src="<?php $this->options->themeUrl('src/index.js') ?>"></script>
</main>
<?php $this->footer(); ?>
<?php $this->need('footer.php'); ?>