-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
32 lines (28 loc) · 990 Bytes
/
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
<?php
$states = [
'x.comment.page.type' => 'Markdown',
'x.page.page.type' => 'Markdown'
];
foreach ($states as $k => $v) {
!State::get($k) && State::set($k, $v);
}
$z = defined('TEST') && TEST ? '.' : '.min.';
Asset::set(__DIR__ . D . 'icons' . $z . 'css', 20);
Asset::set(__DIR__ . D . 'index' . D . ($state->y->contrast->skin ?: 'minimal') . $z . 'css', 20.1);
// Create site link data to be used in navigation
lot('links', $links = new Anemone((static function ($links, $state, $url) {
$index = LOT . D . 'page' . D . trim(strtr($state->route ?? 'index', '/', D), D) . '.page';
$path = $url->path . '/';
foreach (g(LOT . D . 'page', 'page') as $k => $v) {
// Exclude home page
if ($k === $index) {
continue;
}
$v = new Page($k);
// Add current state
$v->current = 0 === strpos($path, '/' . $v->name . '/');
$links[$k] = $v;
}
ksort($links);
return $links;
})([], $state, $url)));