-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta.php
40 lines (34 loc) · 1.02 KB
/
meta.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
<?php
$metas = [];
if (isset($state->x->feed)) {
$metas[$url . ($state->routeBlog ?? '/article') . '/feed.xml'] = 'RSS';
}
if (isset($state->x->sitemap)) {
$metas[$url . '/sitemap.xml'] = 'Sitemap';
}
if (isset($state->x->user)) {
$route = $state->x->user->route ?? '/user';
$route_secret = $state->x->user->guard->route ?? $route;
if (Is::user()) {
$metas[$url . $route_secret . '/' . $user->name . $url->query([
'exit' => $user->token,
'kick' => $url->path
])] = 'Exit';
} else {
$metas[$url . $route_secret . $url->query([
'kick' => $url->path
])] = 'Enter';
}
}
// Make sure that list is not empty so that the copyright line will not shift up coverring the hard-drawn horizontal rule
!$metas && ($metas[$url . ""] = 'Home');
if ($metas) {
asort($metas);
echo '<ul>';
foreach ($metas as $k => $v) {
echo '<li>';
echo '<a href="' . eat($k) . '">' . i($v) . '</a>';
echo '</li>';
}
echo '</ul>';
}