File size: 1,533 Bytes
db39944
 
 
 
bfe985b
db39944
 
 
 
 
 
6425f35
db39944
 
6425f35
 
 
 
 
bfe985b
6425f35
 
db39944
d74feb3
6425f35
d74feb3
 
 
 
 
 
 
 
 
 
 
 
 
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
<script lang="ts">
	import * as config from '$lib/config'
	import type { Snippet } from '$lib/types'
	import CodeBlock from '$lib/components/CodeBlock.svelte'
	import OpenDiscussion from '$lib/components/OpenDiscussion.svelte'
	export let data: { snippets: Snippet[] }
</script>

<svelte:head>
	<title>{config.title} in DuckDB</title>
	<meta name="description" content="A collection of snippets for DuckDB." />
	
</svelte:head>

<section class="max-w-3xl mx-auto px-4 py-12 pb-32">
	<h1 class="text-6xl mt-10 font-bold text-center tracking-tight text-slate-800 mb-8">{config.title}</h1>
	<p class="text-lg text-center text-slate-600">{config.description}</p>
	<p class="text-lg text-center text-slate-600 mb-8">Open a discussion to request a new snippet.</p>
	<div class="flex justify-center mb-16">
		<OpenDiscussion href="https://huggingface.co/spaces/cfahlgren1/sql-snippets/discussions/new?title=Request+for+a+new+snippet%3A" />
	</div>

	<ul class="space-y-12">
		{#each data.snippets as snippet}
			<li class="bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow duration-300">
				<div class="p-4">
					<a href={`${snippet.slug}`} class="block mb-4 hover:underline transition-colors duration-300">
						<h2 class="text-2xl font-bold transition-colors duration-300">{snippet.title}</h2>
					</a>
					<p class="text-sm text-slate-700 font-mono mb-6">{snippet.description}</p>
					{#if snippet.code}
						<CodeBlock code={snippet.code} language="sql" />
					{/if}
				</div>
			</li>
		{/each}
	</ul>
</section>