mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 04:22:13 +00:00
Merge branch 'main' into eldadfux-patch-network
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import Docs, { type DocsLayoutVariant } from '$lib/layouts/Docs.svelte';
|
||||
import Sidebar from '../Sidebar.svelte';
|
||||
|
||||
$: variant =
|
||||
$page.route.id === '/docs/tutorials' ? 'default' : ('two-side-navs' as DocsLayoutVariant);
|
||||
page.route.id === '/docs/tutorials' ? 'default' : ('two-side-navs' as DocsLayoutVariant);
|
||||
</script>
|
||||
|
||||
<Docs {variant}>
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
'Follow a simple tutorial to get started with Appwrite in your preferred framework quickly and easily.';
|
||||
const ogImage = DEFAULT_HOST + '/images/open-graph/docs.png';
|
||||
|
||||
export let data;
|
||||
let { data } = $props();
|
||||
|
||||
type MappedTutorial = (typeof data.tutorials)[number];
|
||||
type MappedTutorial = (typeof data.tutorials)[number]['tutorials'][number];
|
||||
|
||||
const iconMap: Record<string, string> = {
|
||||
'react native': 'icon-react-native',
|
||||
@@ -64,7 +64,7 @@
|
||||
<h1 class="text-title font-aeonik-pro">Tutorials</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="web-article-header-end" />
|
||||
<div class="web-article-header-end"></div>
|
||||
</header>
|
||||
<div class="web-article-content web-u-gap-80">
|
||||
{#each data.tutorials as category}
|
||||
@@ -84,7 +84,7 @@
|
||||
<span
|
||||
class="{getIcon(tutorial)} web-u-font-size-24"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
></span>
|
||||
<h3 class="text-sub-body text-primary font-medium">
|
||||
{tutorial.framework}
|
||||
</h3>
|
||||
@@ -97,7 +97,7 @@
|
||||
<span
|
||||
class="{getIcon(tutorial)} web-u-font-size-24"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
></span>
|
||||
<h3 class="text-sub-body text-primary font-medium">
|
||||
{tutorial.framework}
|
||||
</h3>
|
||||
|
||||
@@ -55,13 +55,14 @@ export async function load() {
|
||||
|
||||
const tutorials = Object.entries(
|
||||
allTutorials.reduce((acc: { [key: string]: any[] }, item) => {
|
||||
const cat = item.category as string;
|
||||
// If the category does not exist in the accumulator, initialize it
|
||||
if (!acc[item.category]) {
|
||||
acc[item.category] = [];
|
||||
if (!acc[cat]) {
|
||||
acc[cat] = [];
|
||||
}
|
||||
|
||||
// Push the current item into the appropriate category
|
||||
acc[item.category].push(item);
|
||||
acc[cat].push(item);
|
||||
|
||||
return acc;
|
||||
}, {})
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { globToTutorial } from '$lib/utils/tutorials.js';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let data;
|
||||
let { data, children } = $props();
|
||||
const tutorials = globToTutorial(data);
|
||||
setContext('tutorials', tutorials);
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children()}
|
||||
|
||||
Reference in New Issue
Block a user