Files
blitzkit/packages/website/src/layouts/ToolLayout.astro
T

55 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-09-17 22:13:35 -05:00
---
import { imgur, ImgurSize } from '@blitzkit/core';
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
import { TOOLS } from '../constants/tools';
import RootLayout from './RootLayout.astro';
const { pathname } = Astro.url;
const pathSplit = pathname.split('/');
const toolId = pathSplit.at(2);
const isToolRoot = pathname === `/tools/${toolId}`;
const tool = TOOLS.find((tool) => tool.id === toolId);
---
<RootLayout>
{
2024-10-09 22:04:43 -05:00
tool && isToolRoot && (
2024-09-17 22:13:35 -05:00
<>
2024-10-09 22:04:43 -05:00
<title>{tool.title}</title>
<meta property="og:image" content={imgur(tool.image)} />
2024-09-17 22:13:35 -05:00
2024-10-09 22:04:43 -05:00
{tool.pageDescription !== undefined && (
<>
<meta name="description" content={tool.pageDescription} />
<meta property="og:description" content={tool.pageDescription} />
2024-09-17 22:13:35 -05:00
</>
)}
2024-10-09 22:04:43 -05:00
<Box
2024-09-17 22:13:35 -05:00
style={{
2024-10-09 22:04:43 -05:00
backgroundImage: `url(${imgur(tool!.image, {
format: 'jpeg',
size: ImgurSize.SmallThumbnail,
})})`,
backgroundSize: 'cover',
2024-09-17 22:13:35 -05:00
}}
>
2024-10-09 22:04:43 -05:00
<Flex
direction="column"
align="center"
py="6"
style={{
backdropFilter: 'blur(4rem)',
WebkitBackdropFilter: 'blur(4rem)',
}}
>
<Heading size="7">{tool?.title}</Heading>
<Text>{tool?.description}</Text>
</Flex>
</Box>
</>
2024-09-17 22:13:35 -05:00
)
}
<slot />
</RootLayout>