Skip to content

Commit bf0080c

Browse files
committed
[fix] added doctype and improve lang attributes
1 parent 278f34d commit bf0080c

File tree

3 files changed

+52
-44
lines changed

3 files changed

+52
-44
lines changed

apps/www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "www",
3-
"version": "1.16.5",
3+
"version": "1.16.6",
44
"module": "src/index.js",
55
"scripts": {
66
"dev": "bun run --hot src/index.tsx",

apps/www/src/components/page.component.jsx

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -114,55 +114,61 @@ export function Page({
114114
class: className,
115115
url,
116116
favicon,
117-
lang = "en",
117+
lang,
118118
...restProps
119119
}) {
120120
return (
121-
<html lang={lang}>
122-
<head>
123-
<meta charset="UTF-8" />
124-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
125-
<title safe>{seo.title}</title>
126-
{seo.description ? (
127-
<meta name="description" content={seo.description} />
128-
) : null}
129-
{seo.author ? <meta name="author" content={seo.author} /> : null}
130-
{seo.robots ? (
131-
<meta name="robots" content={seo.robots.join(", ")} />
132-
) : null}
133-
{seo.openGraph ? <SeoOpenGraph {...seo.openGraph} /> : null}
134-
{seo.twitter ? <SeoTwitter {...seo.twitter} /> : null}
135-
{favicon ? (
136-
<link rel="shortcut icon" href={favicon} type="image/x-icon" />
137-
) : null}
138-
<link rel="stylesheet" href="/public/styles/index.css" />
139-
<script src="/public/script/app.js" defer></script>
140-
<script
141-
src="https://unpkg.com/htmx.org@1.9.11"
142-
integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0"
143-
crossorigin="anonymous"
144-
></script>
145-
<script src="https://unpkg.com/htmx.org/dist/ext/response-targets.js"></script>
146-
<script src="https://unpkg.com/htmx.org/dist/ext/loading-states.js"></script>
147-
{seo.jsonLd ? (
148-
<script type="application/ld+json">
149-
{JSON.stringify(seo.jsonLd)}
150-
</script>
151-
) : null}
152-
</head>
153-
<body
154-
class={clsx(className)}
155-
hx-ext="response-targets"
156-
x-data="{ currentUrl: new URL(window.location) }"
157-
x-init={`
121+
<>
122+
{"<!DOCTYPE html>"}
123+
<html lang={lang}>
124+
<head>
125+
<meta charset="UTF-8" />
126+
<meta
127+
name="viewport"
128+
content="width=device-width, initial-scale=1.0"
129+
/>
130+
<title safe>{seo.title}</title>
131+
{seo.description ? (
132+
<meta name="description" content={seo.description} />
133+
) : null}
134+
{seo.author ? <meta name="author" content={seo.author} /> : null}
135+
{seo.robots ? (
136+
<meta name="robots" content={seo.robots.join(", ")} />
137+
) : null}
138+
{seo.openGraph ? <SeoOpenGraph {...seo.openGraph} /> : null}
139+
{seo.twitter ? <SeoTwitter {...seo.twitter} /> : null}
140+
{favicon ? (
141+
<link rel="shortcut icon" href={favicon} type="image/x-icon" />
142+
) : null}
143+
<link rel="stylesheet" href="/public/styles/index.css" />
144+
<script src="/public/script/app.js" defer></script>
145+
<script
146+
src="https://unpkg.com/htmx.org@1.9.11"
147+
integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0"
148+
crossorigin="anonymous"
149+
></script>
150+
<script src="https://unpkg.com/htmx.org/dist/ext/response-targets.js"></script>
151+
<script src="https://unpkg.com/htmx.org/dist/ext/loading-states.js"></script>
152+
{seo.jsonLd ? (
153+
<script type="application/ld+json">
154+
{JSON.stringify(seo.jsonLd)}
155+
</script>
156+
) : null}
157+
</head>
158+
<body
159+
class={clsx(className)}
160+
hx-ext="response-targets"
161+
x-data="{ currentUrl: new URL(window.location) }"
162+
x-init={`
158163
navigation.addEventListener('navigate', ({ destination }) => {
159164
currentUrl = new URL(destination.url);
160165
});
161166
`}
162-
{...restProps}
163-
>
164-
{children}
165-
</body>
166-
</html>
167+
{...restProps}
168+
>
169+
{children}
170+
</body>
171+
</html>
172+
</>
167173
);
168174
}

apps/www/src/views/layouts.view.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export function RootLayout({
2323
seo,
2424
url,
2525
isHTMX,
26+
lang,
2627
...restProps
2728
}) {
2829
return isHTMX ? (
@@ -35,6 +36,7 @@ export function RootLayout({
3536
class={clsx(className)}
3637
favicon={defaultFavicon}
3738
seo={seo}
39+
lang={lang || "en"}
3840
{...restProps}
3941
x-bind:class={"$store.darkMode && 'dark'"}
4042
>

0 commit comments

Comments
 (0)