()
| 17 | const FONTS = ['inter', 'inconsolata', 'shantell']; |
| 18 | |
| 19 | export const Page: NoPropComponent = () => { |
| 20 | const pageNode = usePageNode(); |
| 21 | const rootNode = useRootNode(); |
| 22 | const isSingle = useIsSingle(); |
| 23 | const baseUrl = useBaseUrl(); |
| 24 | const isHome = pageNode == rootNode; |
| 25 | |
| 26 | if (pageNode.summary?.startsWith('->')) { |
| 27 | return ( |
| 28 | <meta |
| 29 | httpEquiv="refresh" |
| 30 | content={`0;url=${pageNode.summary.substring(2).trim()}`} |
| 31 | /> |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | const title = |
| 36 | (pageNode.name != 'TinyBase' ? pageNode.name + ' | ' : '') + 'TinyBase'; |
| 37 | const description = isHome |
| 38 | ? 'A reactive data store and sync engine.' |
| 39 | : pageNode.reflection == null |
| 40 | ? getSummaryMarkdown(pageNode).replace(/\s+/g, ' ') |
| 41 | : (NodeSummary({node: pageNode, asText: true}) as unknown as string); |
| 42 | const url = `${baseUrl}${pageNode.url}`; |
| 43 | |
| 44 | return ( |
| 45 | <BuildContext> |
| 46 | <html lang="en"> |
| 47 | <head> |
| 48 | <link rel="dns-prefetch" href="https://www.googletagmanager.com/" /> |
| 49 | <link |
| 50 | href={`https://www.googletagmanager.com/gtag/js?id=${GTM_ID}`} |
| 51 | rel="preload" |
| 52 | as="script" |
| 53 | /> |
| 54 | {FONTS.map((font) => ( |
| 55 | <link |
| 56 | rel="preload" |
| 57 | as="font" |
| 58 | href={`/fonts/${font}.woff2`} |
| 59 | type="font/woff2" |
| 60 | crossOrigin="anonymous" |
| 61 | key={font} |
| 62 | /> |
| 63 | ))} |
| 64 | |
| 65 | <title>{title}</title> |
| 66 | <meta name="description" content={description} /> |
| 67 | |
| 68 | <meta property="og:type" content="website" /> |
| 69 | <meta property="og:title" content={title} /> |
| 70 | <meta property="og:description" content={description} /> |
| 71 | <meta property="og:url" content={url} /> |
| 72 | <meta property="og:image" content={`${baseUrl}/favicon_pad.png`} /> |
| 73 | |
| 74 | <meta name="twitter:card" content="summary" /> |
| 75 | <meta name="twitter:title" content={title} /> |
| 76 | <meta name="twitter:description" content={description} /> |
nothing calls this directly
no test coverage detected
searching dependent graphs…