-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathHead.tsx
More file actions
26 lines (24 loc) · 755 Bytes
/
Head.tsx
File metadata and controls
26 lines (24 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
import { Head as _Head } from "$fresh/runtime.ts";
import Meta, { type MetaProps } from "./Meta.tsx";
import { SITE_DESCRIPTION, SITE_NAME } from "@/utils/constants.ts";
import { ComponentChildren } from "preact";
export type HeadProps =
& Partial<Omit<MetaProps, "href">>
& Pick<MetaProps, "href">
& {
children?: ComponentChildren;
};
export default function Head(props: HeadProps) {
return (
<_Head>
<Meta
title={props?.title ? `${props.title} ▲ ${SITE_NAME}` : SITE_NAME}
description={props?.description ?? SITE_DESCRIPTION}
href={props.href}
imageUrl="/cover.png"
/>
{props.children}
</_Head>
);
}