/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see .
*/
/** @jsxRuntime automatic */
/** @jsxImportSource hono/jsx */
import {Footer} from '@fluxer/marketing/src/components/Footer';
import {LocaleSelectorModal} from '@fluxer/marketing/src/components/LocaleSelector';
import {Navigation} from '@fluxer/marketing/src/components/Navigation';
import type {MarketingContext} from '@fluxer/marketing/src/MarketingContext';
import {getCurrentPath} from '@fluxer/marketing/src/PathUtils';
import {buildIconLinks} from '@fluxer/marketing/src/pages/layout/Icons';
import type {PageMeta} from '@fluxer/marketing/src/pages/layout/Meta';
import {buildMetaTags} from '@fluxer/marketing/src/pages/layout/Meta';
import {docsPageScript, downloadScript, mainPageScript} from '@fluxer/marketing/src/pages/layout/Scripts';
import {cacheBustedAsset} from '@fluxer/marketing/src/UrlUtils';
import type {Context} from 'hono';
export function renderLayout(
req: Context,
ctx: MarketingContext,
pageMeta: PageMeta,
content: ReadonlyArray,
): JSX.Element {
const currentPath = getCurrentPath(getPathWithinBasePath(req.req.path, ctx.basePath));
const pageUrl = currentPath === '/' ? ctx.baseUrl : `${ctx.baseUrl}${currentPath}`;
return (
{buildMetaTags(ctx, pageMeta, pageUrl)}
{pageMeta.title}
{buildIconLinks(ctx.staticCdnEndpoint)}
{mainPageScript()}
{downloadScript()}