Skip to content

Commit cc9d9e8

Browse files
committed
USE v3 DOCS AS DEFAULT
1 parent b2f3259 commit cc9d9e8

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

docs/src/components/Navigation.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import { Icon } from 'astro-icon/components';
33
44
let segments = Astro.url.pathname.match(/\/([0-9]*\.x)\/([a-z\-\_]*)\//) || [
5-
'/4.x/introduction/overview/',
6-
'4.x',
7-
'introduction',
8-
'overview',
5+
'/3.x/panels/installation/',
6+
'3.x',
7+
'panels',
8+
'installation',
99
]
1010
1111
const { navigation } = Astro.props

docs/src/components/VersionSelector.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import navigation from '../navigation.json'
33
4-
let segments = Astro.url.pathname.match(/\/([0-9]*\.x)\/([a-z\-\_]*)\/([a-z\-\_]*)\/([a-z\-\_]*)/) || ["/4.x/introduction/overview/", "4.x", "introduction", "overview"];
4+
let segments = Astro.url.pathname.match(/\/([0-9]*\.x)\/([a-z\-\_]*)\/([a-z\-\_]*)\/([a-z\-\_]*)/) || ["/3.x/panels/installation/", "3.x", "panels", "installation"];
55
let currentVersion = segments[1].replaceAll("/", "");
66
let currentSection = segments[2].replaceAll("/", "");
77
let currentPage = (segments[3] ?? null)?.replaceAll("/", "");
@@ -46,7 +46,7 @@ const versions = navigation.map((version) => {
4646
aria-label="Open version options"
4747
>
4848
<span class="hidden sm:block">Version&nbsp;</span>
49-
<span id="current-version" class="font-bold">{currentVersion}</span>
49+
<span id="current-version" class="font-bold">{currentVersion} {(currentVersion === '4.x') ? 'beta' : ''}</span>
5050
</button>
5151

5252
<div
@@ -59,7 +59,7 @@ const versions = navigation.map((version) => {
5959
{versions.map((version) => (
6060
<a
6161
href={version.href}
62-
class="flex justify-center items-center rounded-[0.5rem] py-1 px-3 w-full hover:bg-gray-100 hover:dark:bg-gray-900/40 transition duration-200"
62+
class="flex justify-start items-center rounded-[0.5rem] py-1 px-3 w-full hover:bg-gray-100 hover:dark:bg-gray-900/40 transition duration-200"
6363
class:list={[
6464
{
6565
'text-primary-500 hover:text-primary-500 hover:dark:text-primary-500': version.version === currentVersion,
@@ -70,7 +70,7 @@ const versions = navigation.map((version) => {
7070
]}
7171
>
7272
<span>Version&nbsp;</span>
73-
<span>{version.version}</span>
73+
<span>{version.version} {(version.version === '4.x') ? 'beta' : ''}</span>
7474
</a>
7575
))}
7676
</div>

docs/src/layouts/BaseLayout.astro

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import { collectHeadings, getAllLinks } from "src/lib/helpers";
3+
import Aside from "@components/Aside.astro";
34
import Navigation from "@components/Navigation.astro";
45
import Footer from "@components/Footer.astro";
56
import Header from "@components/Header.astro";
@@ -28,7 +29,7 @@ let isHomePage = Astro.url.pathname === "/docs";
2829
2930
let tableOfContents = headings.length > 0 ? collectHeadings(headings) : [];
3031
31-
let segments = Astro.url.pathname.match(/\/([0-9]*\.x)\/([a-z\-\_]*)\/([a-z\-\_]*)/) || ["/4.x/introduction/overview/", "4.x", "introduction", "overview"];
32+
let segments = Astro.url.pathname.match(/\/([0-9]*\.x)\/([a-z\-\_]*)\/([a-z\-\_]*)/) || ["/4.x/introduction/overview/", "3.x", "panels", "installation"];
3233
3334
let currentVersion = segments[1].replaceAll("/", "");
3435
let currentPackage = segments[2].replaceAll("/", "");
@@ -170,6 +171,12 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site);
170171
</div>
171172
</div>
172173
<div class="min-w-0 max-w-2xl flex-auto px-4 py-16 lg:max-w-none lg:pr-0 lg:pl-8 xl:pl-16 xl:pr-10">
174+
{(currentVersion === '4.x') && (
175+
<Aside variant="info">
176+
Filament v4 is currently in beta and is not stable. Please report any issues you encounter on <a href="https://github.com/filamentphp/filament/issues/new" target="_blank">GitHub</a>.
177+
</Aside>
178+
)}
179+
173180
<article>
174181
{(title || section) && (
175182
<header class="mb-9 space-y-1">

routes/web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
Route::redirect('/discord', 'https://discord.gg/filament')->name('discord');
5656

57-
Route::get('/api/{version?}', function (string $version = '4.x'): RedirectResponse {
57+
Route::get('/api/{version?}', function (string $version = '3.x'): RedirectResponse {
5858
return redirect('/api/' . $version . '/index.html');
5959
})->where('version', '[1-4]+\.x')->name('api-docs');
6060

@@ -74,7 +74,7 @@
7474
$slug = trim($slug, '/');
7575

7676
if (filled($slug) && (! str_contains($slug, '.x'))) {
77-
return redirect()->route('docs', ['slug' => "4.x/{$slug}"]);
77+
return redirect()->route('docs', ['slug' => "3.x/{$slug}"]);
7878
}
7979

8080
$filePath = base_path("docs/preserved-dist/{$slug}/index.html");

0 commit comments

Comments
 (0)