Skip to content

Commit

Permalink
Fixes #2034
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Nov 4, 2023
1 parent 07dc206 commit 86bc50d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
6 changes: 4 additions & 2 deletions site/models/reference-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ReferenceEndpointPage extends ReflectionPage
{
public function request(): string
{
return $this->method() . ': ' . $this->title();
return $this->info() . ': ' . $this->title();
}

public function metadata(): array
Expand All @@ -22,6 +22,8 @@ public function metadata(): array

public function title(): Field
{
return parent::title()->value('/api' . parent::title());
return parent::title()->value(
'<code>' . $this->info() . '</code> /api' . parent::title()
);
}
}
12 changes: 10 additions & 2 deletions site/snippets/templates/reference/entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
<ul>
<?php foreach ($page->siblings()->listed() as $entry): ?>
<li data-id="<?= $entry->id() ?>">
<a <?= ariaCurrent($entry->isOpen(), 'page') ?> href="<?= $entry->url() ?>" class="flex items-center">
<?php snippet('templates/reference/entry/icon', ['entry' => $entry]) ?>
<a
<?= ariaCurrent($entry->isOpen(), 'page') ?>
href="<?= $entry->url() ?>"
class="flex items-center"
>
<?php snippet(
'templates/reference/entry/decoration',
['entry' => $entry])
?>

<div class="flex-grow">
<h4 class="h6"><?= $entry->title() ?></h4>
<div class="color-gray-700 text-xs">
Expand Down
7 changes: 7 additions & 0 deletions site/snippets/templates/reference/entry/decoration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php if ($entry->intendedTemplate()->name() === 'reference-icon'): ?>
<figure class="p-3 mr-3 bg-light rounded">
<svg style="width: 1rem; height: 1rem;">
<use xlink:href="#icon-<?= $entry->slug() ?>" />
</svg>
</figure>
<?php endif ?>
15 changes: 0 additions & 15 deletions site/snippets/templates/reference/entry/icon.php

This file was deleted.

0 comments on commit 86bc50d

Please sign in to comment.