Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Sep 8, 2022
1 parent dae7443 commit 6ac8fe5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$z = defined('TEST') && TEST ? '.' : '.min.';
Asset::set(__DIR__ . D . 'index' . $z . 'css', 20);

$GLOBALS['links'] = new Anemone((static function($links, $state, $url) {
$GLOBALS['links'] = new Anemone((static function ($links, $state, $url) {
$index = LOT . D . 'page' . D . trim(strtr($state->route, '/', D), D) . '.page';
$path = $url->path . '/';
foreach (g(LOT . D . 'page', 'page') as $k => $v) {
Expand Down Expand Up @@ -35,20 +35,20 @@
}

if (isset($state->x->alert)) {
Hook::set('route.archive', function($content, $path, $query, $hash, $data) {
Hook::set('route.archive', function ($content, $path, $query, $hash, $data) {
$archive = new Time(substr_replace('1970-01-01-00-00-00', $name = $data['name'], 0, strlen($name)));
Alert::info('Showing %s published in %s.', ['posts', '<em>' . $archive->i((false === strpos($name, '-') ? "" : '%B ') . '%Y') . '</em>']);
});
Hook::set('route.search', function($content, $path, $query, $hash, $data) {
Hook::set('route.search', function ($content, $path, $query, $hash, $data) {
Alert::info('Showing %s matched with query %s.', ['posts', '<em>' . $data['query'] . '</em>']);
});
Hook::set('route.tag', function($content, $path, $query, $hash, $data) {
Hook::set('route.tag', function ($content, $path, $query, $hash, $data) {
if (is_file($file = LOT . D . 'tag' . D . $data['name'] . '.page')) {
$tag = new Tag($file);
Alert::info('Showing %s tagged in %s.', ['posts', '<em>' . $tag->title . '</em>']);
}
});
Hook::set('y.alert', function($alert) {
Hook::set('y.alert', function ($alert) {
foreach ($alert[1] as &$v) {
$v[2]['aria-live'] = ['error' => 'assertive', 'info' => 'off', 'success' => 'polite'][$v[2]['type'] ?? $v['type']] ?? null;
}
Expand All @@ -58,7 +58,7 @@
}

if (isset($state->x->excerpt) && $state->is('page')) {
Hook::set('page.content', function($content) {
Hook::set('page.content', function ($content) {
return strtr($content, ["\f" => '<hr id="next:' . $this->id . '" role="doc-pagebreak">']);
});
}
2 changes: 1 addition & 1 deletion index/panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$_POST['state']['y']['outdoorsy']['page']['header'] = false;
}

Hook::set('_', function($_) use($state, $url) {
Hook::set('_', function ($_) use ($state, $url) {
if ('.state' === $_['path']) {
$time = new Time;
$formats = [];
Expand Down

0 comments on commit 6ac8fe5

Please sign in to comment.