Skip to content

Commit 32ff29c

Browse files
committed
wip
1 parent 48015a5 commit 32ff29c

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

src/Web/CommandPalette/CommandIndexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Web\CommandPalette;
44

55
use App\Web\Blog\BlogController;
6-
use App\Web\Documentation\ChapterController;
6+
use App\Web\Documentation\DocumentationController;
77
use App\Web\RedirectsController;
88
use Tempest\Support\Arr\ImmutableArray;
99

@@ -18,7 +18,7 @@ public function index(): ImmutableArray
1818
title: 'Read the documentation',
1919
type: Type::URI,
2020
hierarchy: ['Commands', 'Documentation'],
21-
uri: uri([ChapterController::class, 'index']),
21+
uri: uri([DocumentationController::class, 'index']),
2222
),
2323
new Command(
2424
title: 'Visit the blog',

src/Web/Documentation/Chapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323

2424
public function getUri(): string
2525
{
26-
return uri(ChapterController::class, version: $this->version, category: $this->category, slug: $this->slug);
26+
return uri(DocumentationController::class, version: $this->version, category: $this->category, slug: $this->slug);
2727
}
2828

2929
public function getMetaUri(): string

src/Web/Documentation/ChapterController.php renamed to src/Web/Documentation/DocumentationController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use function Tempest\Support\Str\before_first;
1717
use function Tempest\uri;
1818

19-
final readonly class ChapterController
19+
final readonly class DocumentationController
2020
{
2121
#[Get('/current/{path:.*}')]
2222
#[Get('/main/{path:.*}')]
@@ -47,8 +47,8 @@ public function index(): Redirect
4747

4848
return new Redirect(uri(
4949
[self::class, 'default'],
50-
category: $category,
51-
slug: $slug,
50+
category: str_replace('0-', '', $category),
51+
slug: str_replace('01-', '', $slug),
5252
));
5353
}
5454

src/Web/Documentation/DocumentationIndexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function index(): ImmutableArray
5757
$main = new Command(
5858
type: Type::URI,
5959
title: $title,
60-
uri: uri(ChapterController::class, version: $version, category: $category, slug: $chapter),
60+
uri: uri(DocumentationController::class, version: $version, category: $category, slug: $chapter),
6161
hierarchy: [
6262
'Documentation',
6363
to_sentence_case($category),

src/Web/Homepage/home.view.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use App\Web\Blog\BlogController;
4-
use App\Web\Documentation\ChapterController;
4+
use App\Web\Documentation\DocumentationController;
55
use App\Web\RedirectsController;
66

77
use function Tempest\uri;
@@ -30,7 +30,7 @@
3030
Tempest embraces modern PHP and covers a wide range of features, giving you all the tools you need to focus on your code.
3131
</p>
3232
<div class="mt-6 md:mt-8 xl:mt-10 flex gap-x-4 items-center font-medium text-lg">
33-
<a :href="uri([ChapterController::class, 'index'])" class="bg-(--ui-bg-inverted) text-(--ui-bg) hover:bg-(--ui-bg-inverted)/90 rounded-xl px-6 py-2.5 gap-1.5 transition">
33+
<a :href="uri([DocumentationController::class, 'index'])" class="bg-(--ui-bg-inverted) text-(--ui-bg) hover:bg-(--ui-bg-inverted)/90 rounded-xl px-6 py-2.5 gap-1.5 transition">
3434
Get started
3535
</a>
3636
<a :href="uri([RedirectsController::class, 'github'])" class="hidden min-[401px]:flex text(--ui-text) hover:bg-(--ui-info)/10 group rounded-xl px-6 py-2.5 items-center gap-x-1.5 transition">
@@ -57,7 +57,7 @@
5757
'Tempest doesn\'t require hand-holding. Your code is scanned and everything is configured automatically: routes, view components, console commands, event handlers, middleware, migrations — everything.',
5858
]"
5959
link-label="Discovery"
60-
:link-uri="uri(ChapterController::class, version: \App\Web\Documentation\Version::default(), category: 'internals', slug: 'discovery')"
60+
:link-uri="uri(DocumentationController::class, version: \App\Web\Documentation\Version::default(), category: 'internals', slug: 'discovery')"
6161
:snippets="['controller', 'view-component', 'event-handler']"
6262
></x-home-section>
6363
<!-- Template engine -->
@@ -68,7 +68,7 @@
6868
'Do you prefer something tried and tested? Tempest has built-in support for Blade and Twig as well.',
6969
]"
7070
link-label="Templating"
71-
:link-uri="uri(ChapterController::class, version: \App\Web\Documentation\Version::default(), category: 'essentials', slug: 'views')"
71+
:link-uri="uri(DocumentationController::class, version: \App\Web\Documentation\Version::default(), category: 'essentials', slug: 'views')"
7272
:snippets="['templating-view', 'templating-component']"
7373
></x-home-section>
7474
<!-- ORM-->
@@ -78,7 +78,7 @@
7878
'Models in Tempest embrace modern PHP and are designed to be decoupled from the database; they don\'t even have to persist to the database and can be mapped to any kind of data source.',
7979
]"
8080
link-label="ORM"
81-
:link-uri="uri(ChapterController::class, version: \App\Web\Documentation\Version::default(), category: 'essentials', slug: 'database')"
81+
:link-uri="uri(DocumentationController::class, version: \App\Web\Documentation\Version::default(), category: 'essentials', slug: 'database')"
8282
:snippets="['model', 'orm']"
8383
></x-home-section>
8484
<!-- Console-->
@@ -88,7 +88,7 @@
8888
'Thinking out of the box, Tempest\'s console component is a brand new approach to building console applications with PHP',
8989
]"
9090
link-label="Console"
91-
:link-uri="uri(ChapterController::class, version: \App\Web\Documentation\Version::default(), category: 'essentials', slug: 'console-commands')"
91+
:link-uri="uri(DocumentationController::class, version: \App\Web\Documentation\Version::default(), category: 'essentials', slug: 'console-commands')"
9292
:snippets="['console']"
9393
></x-home-section>
9494
<!-- Much more-->
@@ -98,7 +98,7 @@
9898
'Configuration objects for easy autocompletion and injection, data mapping, a powerful dependency container with autowiring. Tempest is designed to be frictionless.',
9999
]"
100100
link-label="Get started"
101-
:link-uri="uri([ChapterController::class, 'index'])"
101+
:link-uri="uri([DocumentationController::class, 'index'])"
102102
:snippets="['config', 'static-pages', 'query', 'markdown-initializer']"
103103
></x-home-section>
104104
</main>

src/Web/x-header.view.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use App\Web\Blog\BlogController;
4-
use App\Web\Documentation\ChapterController;
4+
use App\Web\Documentation\DocumentationController;
55
use App\Web\Community\CommunityController;
66

77
use function Tempest\is_current_uri;
@@ -48,8 +48,8 @@ class="transition hover:text-(--ui-text-highlighted) <?= is_current_uri([BlogCon
4848
: '' ?>"
4949
>Blog</a>
5050
<a
51-
:href="uri([ChapterController::class, 'index'])"
52-
class="transition hover:text-(--ui-text-highlighted) <?= is_current_uri([ChapterController::class, '__invoke']) ? 'md:text-(--ui-primary)' : '' ?>"
51+
:href="uri([DocumentationController::class, 'index'])"
52+
class="transition hover:text-(--ui-text-highlighted) <?= is_current_uri([DocumentationController::class, '__invoke']) ? 'md:text-(--ui-primary)' : '' ?>"
5353
>
5454
<span class="sm:hidden">Docs</span>
5555
<span class="hidden sm:inline">Documentation</span>

0 commit comments

Comments
 (0)