-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpages.php
91 lines (91 loc) · 2.83 KB
/
pages.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
<?= self::enter(); ?>
<?php if ($page->exist): ?>
<article class="page" id="page:<?= eat($page->id); ?>">
<header>
<?php if ($title = $page->title): ?>
<h2>
<?= $title; ?>
</h2>
<?php endif; ?>
<?php if ($description = $page->description): ?>
<p>
<?= $description; ?>
</p>
<?php endif; ?>
</header>
<?php $date_time_format = $state->y->outdoor->page->timeFormat ?? '%F %T'; ?>
<?php $x_image = isset($state->x->image); ?>
<?php if ($pages->count): ?>
<?php foreach ($pages as $page): ?>
<article class="page" id="page:<?= eat($page->id); ?>">
<header>
<p>
<time datetime="<?= eat($page->time->format('c')); ?>">
<?= $page->time($date_time_format); ?>
</time>
</p>
<?php if ($title = $page->title): ?>
<h3>
<?php if ($link = $page->link): ?>
<a href="<?= eat($link); ?>" target="_blank">
➠ <?= $title; ?>
</a>
<?php else: ?>
<a href="<?= eat($page->url); ?>">
<?= $title; ?>
</a>
<?php endif; ?>
</h3>
<?php endif; ?>
</header>
<?php if ($x_image && $image = $page->image(120, 120, 100)): ?>
<figure>
<img alt="" height="120" src="<?= eat($image); ?>" width="120">
</figure>
<?php endif; ?>
<div>
<?php if (!$excerpt = $page->excerpt): ?>
<?php $excerpt = '<p>' . To::description($page->content, 250) . '</p>'; ?>
<?php endif; ?>
<?= preg_replace('/<a(\s[^>]*?)?>|<\/a>/', "", $excerpt); ?>
<p role="group">
<a href="<?= eat($page->url); ?>#next:<?= eat($page->id); ?>">
<?= i('Read More'); ?>
</a>
<?php if ($link = $page->link): ?>
<a href="<?= eat($link); ?>" rel="nofollow" target="_blank">
<?= i('Visit Link'); ?>
</a>
<?php endif; ?>
</p>
</div>
</article>
<?php endforeach; ?>
<?php else: ?>
<?php if ($site->has('part')): ?>
<p role="status">
<?= i('No more %s to show.', 'pages'); ?>
</p>
<?php else: ?>
<p role="status">
<?= i('No %s yet.', 'pages'); ?>
</p>
<?php endif; ?>
<?php endif; ?>
<?= self::pager(); ?>
</article>
<?php else: ?>
<article class="page">
<header>
<h2>
<?= i('Error'); ?>
</h2>
</header>
<div>
<p role="status">
<?= i('%s does not exist.', 'Page'); ?>
</p>
</div>
</article>
<?php endif; ?>
<?= self::exit(); ?>