deno.land / x / netzo@0.5.16 / components / head.tsx

نووسراو ببینە
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// @deno-types="npm:@types/react@18.2.60"import * as React from "react";
import { Head as _Head } from "$fresh/runtime.ts";import type { ComponentChildren } from "preact";
export type HeadProps = { /** A short title for the app to be used in head of the page. */ title?: string; /** A short description for the app to be used in head of the page. */ description?: string; /** An https or data URL of the favicon to be shown in browser tabs */ favicon?: string; /** An https or data URL of a cover image shown when sharing the link */ image?: string; /** The canonical URL of the page */ href: string; /** Optional JSX content */ children?: ComponentChildren;};
export const Head = (props: HeadProps) => { return ( <_Head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <Meta title={props.title} description={props.description} href={props.href} image={props.image} /> {props.children} </_Head> );};
export const Meta = (props: HeadProps) => { return ( <> {/* HTML Meta Tags */} <title>{props.title} | Netzo</title> <meta name="description" content={props.description} /> <link rel="icon" href={props.favicon ?? "/favicon.svg"} />
{/* Google / Search Engine Tags */} <meta itemProp="name" content={props.title} /> <meta itemProp="description" content={props.description} /> {props.image && <meta itemProp="image" content={props.image} />}
{/* Facebook Meta Tags */} <meta property="og:type" content="website" /> <meta property="og:site_name" content={props.title} /> <meta property="og:locale" content="en" /> <meta property="og:type" content="website" /> <meta property="og:title" content={props.title} /> <meta property="og:description" content={props.description} /> {/* <meta property="og:url" content={props.href} /> */} <meta property="og:image" content={props.image} />
{/* Twitter Meta Tags */} <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content={props.title} /> <meta name="twitter:description" content={props.description} /> <meta name="twitter:image" content={props.image} /> </> );};
netzo

Version Info

Tagged at
3 weeks ago