feat(cms): expose public document api and trigger site revalidation

This commit is contained in:
2026-02-11 09:00:11 +08:00
parent b6e18a83ec
commit 4e7ef92d0b
10 changed files with 489 additions and 50 deletions

View File

@@ -127,38 +127,46 @@
</div>
<!-- Settings Dropdown -->
<div class="hidden sm:flex sm:items-center sm:ms-6">
<x-dropdown align="right" width="48">
<x-slot name="trigger">
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150 dark:bg-slate-800 dark:text-slate-100 dark:hover:text-white">
<div>{{ Auth::user()->name }}</div>
@auth
<div class="hidden sm:flex sm:items-center sm:ms-6">
<x-dropdown align="right" width="48">
<x-slot name="trigger">
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150 dark:bg-slate-800 dark:text-slate-100 dark:hover:text-white">
<div>{{ Auth::user()->name }}</div>
<div class="ms-1">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</button>
</x-slot>
<div class="ms-1">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</button>
</x-slot>
<x-slot name="content">
<x-dropdown-link :href="route('profile.edit')">
個人檔案
</x-dropdown-link>
<!-- Authentication -->
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-dropdown-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
登出
<x-slot name="content">
<x-dropdown-link :href="route('profile.edit')">
個人檔案
</x-dropdown-link>
</form>
</x-slot>
</x-dropdown>
</div>
<!-- Authentication -->
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-dropdown-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
登出
</x-dropdown-link>
</form>
</x-slot>
</x-dropdown>
</div>
@else
<div class="hidden sm:flex sm:items-center sm:ms-6">
<x-nav-link :href="route('login')" :active="request()->routeIs('login')">
登入
</x-nav-link>
</div>
@endauth
<!-- Hamburger -->
<div class="-me-2 flex items-center sm:hidden">
@@ -279,28 +287,38 @@
</div>
<!-- Responsive Settings Options -->
<div class="pt-4 pb-1 border-t border-gray-200 dark:border-gray-700">
<div class="px-4">
<div class="font-medium text-base text-gray-800 dark:text-slate-200">{{ Auth::user()->name }}</div>
<div class="font-medium text-sm text-gray-500 dark:text-slate-400">{{ Auth::user()->email }}</div>
</div>
@auth
<div class="pt-4 pb-1 border-t border-gray-200 dark:border-gray-700">
<div class="px-4">
<div class="font-medium text-base text-gray-800 dark:text-slate-200">{{ Auth::user()->name }}</div>
<div class="font-medium text-sm text-gray-500 dark:text-slate-400">{{ Auth::user()->email }}</div>
</div>
<div class="mt-3 space-y-1">
<x-responsive-nav-link :href="route('profile.edit')">
個人檔案
</x-responsive-nav-link>
<!-- Authentication -->
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-responsive-nav-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
登出
<div class="mt-3 space-y-1">
<x-responsive-nav-link :href="route('profile.edit')">
個人檔案
</x-responsive-nav-link>
</form>
<!-- Authentication -->
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-responsive-nav-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
登出
</x-responsive-nav-link>
</form>
</div>
</div>
</div>
@else
<div class="pt-4 pb-1 border-t border-gray-200 dark:border-gray-700">
<div class="mt-3 space-y-1">
<x-responsive-nav-link :href="route('login')" :active="request()->routeIs('login')">
登入
</x-responsive-nav-link>
</div>
</div>
@endauth
</div>
</nav>