Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/www/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "www",
"version": "1.16.5",
"version": "1.16.6",
"module": "src/index.js",
"scripts": {
"dev": "bun run --hot src/index.tsx",
Expand Down
92 changes: 49 additions & 43 deletions apps/www/src/components/page.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,55 +114,61 @@ export function Page({
class: className,
url,
favicon,
lang = "en",
lang,
...restProps
}) {
return (
<html lang={lang}>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title safe>{seo.title}</title>
{seo.description ? (
<meta name="description" content={seo.description} />
) : null}
{seo.author ? <meta name="author" content={seo.author} /> : null}
{seo.robots ? (
<meta name="robots" content={seo.robots.join(", ")} />
) : null}
{seo.openGraph ? <SeoOpenGraph {...seo.openGraph} /> : null}
{seo.twitter ? <SeoTwitter {...seo.twitter} /> : null}
{favicon ? (
<link rel="shortcut icon" href={favicon} type="image/x-icon" />
) : null}
<link rel="stylesheet" href="/public/styles/index.css" />
<script src="/public/script/app.js" defer></script>
<script
src="https://unpkg.com/htmx.org@1.9.11"
integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0"
crossorigin="anonymous"
></script>
<script src="https://unpkg.com/htmx.org/dist/ext/response-targets.js"></script>
<script src="https://unpkg.com/htmx.org/dist/ext/loading-states.js"></script>
{seo.jsonLd ? (
<script type="application/ld+json">
{JSON.stringify(seo.jsonLd)}
</script>
) : null}
</head>
<body
class={clsx(className)}
hx-ext="response-targets"
x-data="{ currentUrl: new URL(window.location) }"
x-init={`
<>
{"<!DOCTYPE html>"}
<html lang={lang}>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title safe>{seo.title}</title>
{seo.description ? (
<meta name="description" content={seo.description} />
) : null}
{seo.author ? <meta name="author" content={seo.author} /> : null}
{seo.robots ? (
<meta name="robots" content={seo.robots.join(", ")} />
) : null}
{seo.openGraph ? <SeoOpenGraph {...seo.openGraph} /> : null}
{seo.twitter ? <SeoTwitter {...seo.twitter} /> : null}
{favicon ? (
<link rel="shortcut icon" href={favicon} type="image/x-icon" />
) : null}
<link rel="stylesheet" href="/public/styles/index.css" />
<script src="/public/script/app.js" defer></script>
<script
src="https://unpkg.com/htmx.org@1.9.11"
integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0"
crossorigin="anonymous"
></script>
<script src="https://unpkg.com/htmx.org/dist/ext/response-targets.js"></script>
<script src="https://unpkg.com/htmx.org/dist/ext/loading-states.js"></script>
{seo.jsonLd ? (
<script type="application/ld+json">
{JSON.stringify(seo.jsonLd)}
</script>
) : null}
</head>
<body
class={clsx(className)}
hx-ext="response-targets"
x-data="{ currentUrl: new URL(window.location) }"
x-init={`
navigation.addEventListener('navigate', ({ destination }) => {
currentUrl = new URL(destination.url);
});
`}
{...restProps}
>
{children}
</body>
</html>
{...restProps}
>
{children}
</body>
</html>
</>
);
}
2 changes: 2 additions & 0 deletions apps/www/src/views/layouts.view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function RootLayout({
seo,
url,
isHTMX,
lang,
...restProps
}) {
return isHTMX ? (
Expand All @@ -35,6 +36,7 @@ export function RootLayout({
class={clsx(className)}
favicon={defaultFavicon}
seo={seo}
lang={lang || "en"}
{...restProps}
x-bind:class={"$store.darkMode && 'dark'"}
>
Expand Down