feat(preview): implement preview mode for content management
- Added support for a preview mode in the CMS, allowing draft content to be viewed without being indexed. - Updated hooks and server logic to handle preview parameters, adjusting cache control and robots tags accordingly. - Enhanced layout to display a preview notification when in preview mode, improving user experience for content editors.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
socialImage?: string;
|
||||
robots?: string;
|
||||
keywords?: string;
|
||||
preview?: boolean;
|
||||
jsonLd?: Record<string, unknown> | Record<string, unknown>[];
|
||||
breadcrumbItems?: { href?: string; label: string }[];
|
||||
topBanner?: {
|
||||
@@ -248,6 +249,26 @@
|
||||
class="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[100] focus:bg-white focus:px-3 focus:py-2 focus:shadow focus:outline focus:outline-2 focus:outline-wald-600 focus:rounded-sm"
|
||||
>Zum Inhalt springen</a>
|
||||
<div class="flex min-h-screen flex-col text-zinc-900">
|
||||
{#if pageData?.preview}
|
||||
<div
|
||||
class="sticky top-0 z-[90] w-full bg-amber-500 text-black shadow-sm"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
>
|
||||
<div class="container-custom flex items-center justify-between gap-3 py-1.5 text-sm">
|
||||
<span class="font-semibold">
|
||||
Preview-Modus — Draft sichtbar (nicht indexiert)
|
||||
</span>
|
||||
<a
|
||||
href={$page.url.pathname}
|
||||
class="underline hover:no-underline"
|
||||
rel="nofollow"
|
||||
>
|
||||
Preview verlassen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<Header
|
||||
links={data.headerLinks}
|
||||
socialLinks={data.socialLinks}
|
||||
|
||||
Reference in New Issue
Block a user