-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathlayout.js
More file actions
92 lines (85 loc) · 2.91 KB
/
layout.js
File metadata and controls
92 lines (85 loc) · 2.91 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import { Banner } from '@/components/banner'
import { Footer } from '@/components/footer'
import { Header } from '@/components/header'
import { Link } from '@/components/mdx'
import { Box, Flex } from '@chakra-ui/react'
import Head from 'next/head'
export const Layout = ({
title,
description,
card,
children,
url = 'https://xarray.dev',
enableBanner = false,
}) => {
const bannerTitle = 'Check out the latest blog post:'
// The first link will be the main description for the banner
const bannerDescription = (
<Link href='/blog/flexible-indexing' fontWeight='medium'>
{' '}
{/* Ensure it stands out a bit */}
Xarray indexes: Unleash the power of coordinates!
</Link>
)
// The second link will be passed as children, styled to be smaller
// const bannerChildren = (
// <Link
// href='https://docs.google.com/forms/d/e/1FAIpQLSeGvTLONF-24V7z2HoACm4MhEr82c2V-VIzA9eqM9-jt-Xh8g/viewform?usp=sharing&ouid=111570313164368772519'
// fontSize='sm'
// >
// {' '}
// {/* Add your second link here, smaller font */}
// <b>SciPy 2025</b> Click here for info about an Xarray for Bio Sprint!
// </Link>
//)
// Determine the base URL based on the environment
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: 'http://localhost:3000'
// Construct the full card URL
const fullCardUrl = card.startsWith('http') ? card : `${baseUrl}${card}`
return (
<>
<Head>
<meta content='IE=edge' httpEquiv='X-UA-Compatible' />
<meta content='width=device-width, initial-scale=1' name='viewport' />
<meta property='og:title' content={title} />
<meta property='og:description' content={description} />
<meta property='og:image' content={fullCardUrl} />
<meta property='og:url' content={url} />
<meta name='twitter:title' content={title} />
<meta name='twitter:description' content={description} />
<meta name='twitter:image' content={fullCardUrl} />
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:site' content='@xarray_dev' />
<link
rel='icon'
type='image/png'
sizes='96x96'
href='/Xarray-assets/Icon/Xarray_Icon_final.svg'
/>
<link rel='icon' type='image/svg+xml' href='/favicon.svg' />
<link rel='icon' type='image/png' href='/favicon.png' />
<title>{title}</title>
</Head>
<Flex
direction={'column'}
justify={'space-between'}
gap={0}
minHeight={'100vh'}
>
<Box>
<Header />
{enableBanner && (
<Banner title={bannerTitle} description={bannerDescription}>
{/* {bannerChildren} */}
</Banner>
)}
{children}
</Box>
<Footer />
</Flex>
</>
)
}
export default Layout