Skip to content

Commit d034d59

Browse files
authored
Merge branch 'main' into refactor-env-var-keys
2 parents b3e691d + a14aa7d commit d034d59

26 files changed

Lines changed: 365 additions & 363 deletions

README.md

Lines changed: 136 additions & 284 deletions
Large diffs are not rendered by default.

components/AuthForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2-
import { BASE_BUTTON_STYLES, BASE_INPUT_STYLES } from "@/constants.ts";
2+
import { BASE_BUTTON_STYLES, BASE_INPUT_STYLES } from "@/utils/constants.ts";
33

44
interface AuthFormProps {
55
type: "Login" | "Signup";

components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2-
import { SITE_NAME } from "@/constants.ts";
2+
import { SITE_NAME } from "@/utils/constants.ts";
33
import { JSX } from "preact";
44

55
export default function Footer(props: JSX.HTMLAttributes<HTMLElement>) {

components/Head.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
22
import { Head as _Head } from "$fresh/runtime.ts";
3-
import { SITE_DESCRIPTION, SITE_NAME } from "@/constants.ts";
3+
import { SITE_DESCRIPTION, SITE_NAME } from "@/utils/constants.ts";
4+
import Meta from "@/components/Meta.tsx";
45

56
interface HeadProps {
67
title?: string;
78
description?: string;
9+
href?: string;
810
}
911

10-
export default function Head({ title, description }: HeadProps) {
12+
export default function Head({ title, description, href }: HeadProps) {
1113
return (
1214
<_Head>
13-
<title>{title ?? SITE_NAME}</title>
15+
<Meta
16+
title={title ?? SITE_NAME}
17+
description={description ?? SITE_DESCRIPTION}
18+
href={href}
19+
/>
1420
<link rel="icon" href="/favicon.ico" sizes="32x32" />
15-
<meta name="description" content={description ?? SITE_DESCRIPTION} />
1621
</_Head>
1722
);
1823
}

components/Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
22
import { JSX } from "preact";
3-
import { SITE_NAME } from "@/constants.ts";
3+
import { SITE_NAME } from "@/utils/constants.ts";
44

55
export default function Logo(props: JSX.HTMLAttributes<HTMLImageElement>) {
66
const height = props.height ?? 96;

components/Meta.tsx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2+
import { SITE_DESCRIPTION, SITE_NAME } from "@/utils/constants.ts";
3+
4+
interface MetaProps {
5+
title?: string;
6+
description?: string;
7+
imageUrl?: string;
8+
href?: string;
9+
}
10+
11+
export default function Meta(props: MetaProps) {
12+
const { title, description, imageUrl, href } = props;
13+
14+
return (
15+
<>
16+
{/* HTML Meta Tags */}
17+
<title>{title || SITE_NAME}</title>
18+
<meta
19+
name="description"
20+
content={description || SITE_DESCRIPTION}
21+
/>
22+
23+
{/* Google / Search Engine Tags */}
24+
<meta
25+
itemProp="name"
26+
content={title || SITE_NAME}
27+
/>
28+
<meta
29+
itemProp="description"
30+
content={description || SITE_DESCRIPTION}
31+
/>
32+
{imageUrl && (
33+
<meta
34+
itemProp="image"
35+
content={imageUrl}
36+
/>
37+
)}
38+
39+
{/* Facebook Meta Tags */}
40+
<meta property="og:type" content="website" />
41+
<meta property="og:site_name" content={SITE_NAME} />
42+
<meta property="og:locale" content="en" />
43+
<meta property="og:type" content="website" />
44+
<meta
45+
property="og:title"
46+
content={title || SITE_NAME}
47+
/>
48+
<meta
49+
property="og:description"
50+
content={description || SITE_DESCRIPTION}
51+
/>
52+
{href && (
53+
<meta
54+
property="og:url"
55+
content={href}
56+
/>
57+
)}
58+
{imageUrl && (
59+
<meta
60+
property="og:image"
61+
content={imageUrl}
62+
/>
63+
)}
64+
65+
{/* Twitter Meta Tags */}
66+
<meta name="twitter:card" content="summary_large_image" />
67+
<meta
68+
name="twitter:title"
69+
content={title || SITE_NAME}
70+
/>
71+
<meta
72+
name="twitter:description"
73+
content={description || SITE_DESCRIPTION}
74+
/>
75+
{imageUrl && (
76+
<meta
77+
name="twitter:image"
78+
content={imageUrl}
79+
/>
80+
)}
81+
</>
82+
);
83+
}

components/OAuthLoginButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
22
import type { Provider } from "@supabase/supabase-js";
33
import type { ComponentChild } from "preact";
4-
import { BASE_BUTTON_STYLES } from "@/constants.ts";
4+
import { BASE_BUTTON_STYLES } from "@/utils/constants.ts";
55

66
interface OAuthLoginButtonProps {
77
provider: Provider;
@@ -14,7 +14,7 @@ export default function OAuthLoginButton(props: OAuthLoginButtonProps) {
1414
<input type="hidden" value={props.provider} name="provider" />
1515
<button
1616
type="submit"
17-
class={`${BASE_BUTTON_STYLES} w-full bg-white! text-black border-black border-2 align-middle`}
17+
class={`w-full !bg-white !text-black border-black border-2 align-middle ${BASE_BUTTON_STYLES}`}
1818
>
1919
{props.children}
2020
</button>

deno.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"lock": false,
33
"tasks": {
4+
"init:stripe": "deno run --allow-read --allow-env --allow-net tools/init_stripe.ts ",
45
"start": "deno run -A --watch=static/,routes/ dev.ts",
56
"test": "deno test -A",
67
"check:license": "deno run --allow-read tools/check_license.ts"

dev.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
33

44
import dev from "$fresh/dev.ts";
5-
import { load } from "std/dotenv/mod.ts";
6-
7-
load({ export: true });
5+
import "std/dotenv/load.ts";
86

97
await dev(import.meta.url, "./main.ts");

import_map.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"imports": {
33
"@/": "./",
4-
"$fresh/": "https://deno.land/x/fresh@1.1.4/",
4+
"$fresh/": "https://deno.land/x/fresh@1.1.5/",
55
"$gfm": "https://deno.land/x/gfm@0.2.1/mod.ts",
66
"preact": "https://esm.sh/preact@10.13.2",
77
"preact/": "https://esm.sh/preact@10.13.2/",
88
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.6",
99
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
1010
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
11-
"twind": "https://esm.sh/twind@0.16.19",
12-
"twind/": "https://esm.sh/twind@0.16.19/",
11+
"twind": "https://esm.sh/@twind/core@1.1.3",
12+
"twind-preset-autoprefix": "https://esm.sh/@twind/preset-autoprefix@1.0.7",
13+
"twind-preset-tailwind": "https://esm.sh/@twind/preset-tailwind@1.1.4/base",
14+
"twind-preset-tailwind-colors": "https://esm.sh/@twind/preset-tailwind@1.1.4/colors",
1315
"std/": "https://deno.land/std@0.182.0/",
1416
"stripe": "https://esm.sh/stripe@11.13.0",
1517
"tabler-icons/": "https://deno.land/x/tabler_icons_tsx@0.0.3/tsx/",

0 commit comments

Comments
 (0)