This commit is contained in:
Jesse Winton
2024-08-27 15:06:06 -04:00
parent 9a74791115
commit dc674dd31b
478 changed files with 40014 additions and 41409 deletions

View File

@@ -1,15 +1,13 @@
<script lang="ts">
import { page } from "$app/stores";
import Docs, { type DocsLayoutVariant } from "$lib/layouts/Docs.svelte";
import Sidebar from "../Sidebar.svelte";
import { page } from '$app/stores';
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);
$: variant =
$page.route.id === '/docs/tutorials' ? 'default' : ('two-side-navs' as DocsLayoutVariant);
</script>
<Docs {variant}>
<Sidebar />
<slot />
<Sidebar />
<slot />
</Docs>

View File

@@ -1,133 +1,133 @@
<script lang="ts">
import { MainFooter } from "$lib/components";
import { DEFAULT_HOST } from "$lib/utils/metadata";
import { DOCS_TITLE_SUFFIX } from "$routes/titles";
import { MainFooter } from '$lib/components';
import { DEFAULT_HOST } from '$lib/utils/metadata';
import { DOCS_TITLE_SUFFIX } from '$routes/titles';
const title = "Tutorials" + DOCS_TITLE_SUFFIX;
const description =
"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";
const title = 'Tutorials' + DOCS_TITLE_SUFFIX;
const description =
'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;
export let data;
type MappedTutorial = (typeof data.tutorials)[number];
type MappedTutorial = (typeof data.tutorials)[number];
const iconMap: Record<string, string> = {
"react native": "icon-react-native",
react: "icon-react",
vue: "web-icon-vue",
angular: "icon-angular",
svelte: "icon-svelte",
sveltekit: "icon-svelte",
"sveltekit ssr": "icon-svelte",
android: "icon-android",
apple: "icon-apple",
flutter: "icon-flutter",
nuxt: "icon-nuxt",
"nuxt ssr": "icon-nuxt",
stripe: "icon-stripe",
refine: "web-icon-refine",
"next.js": "icon-nextjs",
"next.js ssr": "icon-nextjs",
astro: "icon-astro",
"astro ssr": "icon-astro",
};
const iconMap: Record<string, string> = {
'react native': 'icon-react-native',
react: 'icon-react',
vue: 'web-icon-vue',
angular: 'icon-angular',
svelte: 'icon-svelte',
sveltekit: 'icon-svelte',
'sveltekit ssr': 'icon-svelte',
android: 'icon-android',
apple: 'icon-apple',
flutter: 'icon-flutter',
nuxt: 'icon-nuxt',
'nuxt ssr': 'icon-nuxt',
stripe: 'icon-stripe',
refine: 'web-icon-refine',
'next.js': 'icon-nextjs',
'next.js ssr': 'icon-nextjs',
astro: 'icon-astro',
'astro ssr': 'icon-astro'
};
const getIcon = (tutorial: MappedTutorial) => {
if (!tutorial.framework) return ""; // TODO: Default icon
return iconMap[tutorial.framework.toLowerCase()];
};
const getIcon = (tutorial: MappedTutorial) => {
if (!tutorial.framework) return ''; // TODO: Default icon
return iconMap[tutorial.framework.toLowerCase()];
};
</script>
<svelte:head>
<!-- Titles -->
<title>{title}</title>
<meta property="og:title" content={title} />
<meta name="twitter:title" content={title} />
<!-- Description -->
<meta name="description" content={description} />
<meta property="og:description" content={description} />
<meta name="twitter:description" content={description} />
<!-- Image -->
<meta property="og:image" content={ogImage} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:image" content={ogImage} />
<meta name="twitter:card" content="summary_large_image" />
<!-- Titles -->
<title>{title}</title>
<meta property="og:title" content={title} />
<meta name="twitter:title" content={title} />
<!-- Description -->
<meta name="description" content={description} />
<meta property="og:description" content={description} />
<meta name="twitter:description" content={description} />
<!-- Image -->
<meta property="og:image" content={ogImage} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:image" content={ogImage} />
<meta name="twitter:card" content="summary_large_image" />
</svelte:head>
<main class="web-main-section" id="main">
<article class="web-article">
<header class="web-article-header">
<div class="web-article-header-start u-flex-vertical web-u-cross-start">
<div class="u-position-relative u-flex u-cross-center">
<h1 class="web-title">Tutorials</h1>
</div>
</div>
<div class="web-article-header-end" />
</header>
<div class="web-article-content web-u-gap-80">
{#each data.tutorials as category}
<section class="u-flex-vertical u-gap-24">
<h2 class="web-eyebrow">{category.title}</h2>
<ul class="web-grid-row-4 web-grid-row-4-mobile-2">
{#each category.tutorials as tutorial}
<li>
{#if tutorial.draft === true}
<a
href={tutorial.href}
class="web-card is-normal draft"
aria-disabled="true"
tabindex="-1"
>
<header class="u-flex u-cross-baseline u-gap-4">
<span
class="{getIcon(tutorial)} web-u-font-size-24"
aria-hidden="true"
/>
<h3 class="web-sub-body-500 web-u-color-text-primary">
{tutorial.framework}
</h3>
<span class="badge web-caption-400">Coming Soon</span>
</header>
</a>
{:else}
<a href={tutorial.href} class="web-card is-normal">
<header class="u-flex u-cross-baseline u-gap-4">
<span
class="{getIcon(tutorial)} web-u-font-size-24"
aria-hidden="true"
/>
<h3 class="web-sub-body-500 web-u-color-text-primary">
{tutorial.framework}
</h3>
</header>
<p class="web-sub-body-400 u-margin-block-start-4">
{tutorial.title}
</p>
</a>
{/if}
</li>
<article class="web-article">
<header class="web-article-header">
<div class="web-article-header-start u-flex-vertical web-u-cross-start">
<div class="u-position-relative u-flex u-cross-center">
<h1 class="web-title">Tutorials</h1>
</div>
</div>
<div class="web-article-header-end" />
</header>
<div class="web-article-content web-u-gap-80">
{#each data.tutorials as category}
<section class="u-flex-vertical u-gap-24">
<h2 class="web-eyebrow">{category.title}</h2>
<ul class="web-grid-row-4 web-grid-row-4-mobile-2">
{#each category.tutorials as tutorial}
<li>
{#if tutorial.draft === true}
<a
href={tutorial.href}
class="web-card is-normal draft"
aria-disabled="true"
tabindex="-1"
>
<header class="u-flex u-cross-baseline u-gap-4">
<span
class="{getIcon(tutorial)} web-u-font-size-24"
aria-hidden="true"
/>
<h3 class="web-sub-body-500 web-u-color-text-primary">
{tutorial.framework}
</h3>
<span class="badge web-caption-400">Coming Soon</span>
</header>
</a>
{:else}
<a href={tutorial.href} class="web-card is-normal">
<header class="u-flex u-cross-baseline u-gap-4">
<span
class="{getIcon(tutorial)} web-u-font-size-24"
aria-hidden="true"
/>
<h3 class="web-sub-body-500 web-u-color-text-primary">
{tutorial.framework}
</h3>
</header>
<p class="web-sub-body-400 u-margin-block-start-4">
{tutorial.title}
</p>
</a>
{/if}
</li>
{/each}
</ul>
</section>
{/each}
</ul>
</section>
{/each}
</div>
</article>
</div>
</article>
<MainFooter variant="docs" />
<MainFooter variant="docs" />
</main>
<style lang="scss">
.badge {
border-radius: 0.25rem;
background: rgba(253, 54, 110, 0.24);
padding: 0.0625rem 0.375rem;
margin-inline-start: 0.25rem;
}
.badge {
border-radius: 0.25rem;
background: rgba(253, 54, 110, 0.24);
padding: 0.0625rem 0.375rem;
margin-inline-start: 0.25rem;
}
.draft {
opacity: 0.4;
pointer-events: none;
}
.draft {
opacity: 0.4;
pointer-events: none;
}
</style>

View File

@@ -1,76 +1,74 @@
import { base } from "$app/paths";
import type { Tutorial } from "$markdoc/layouts/Tutorial.svelte";
import { base } from '$app/paths';
import type { Tutorial } from '$markdoc/layouts/Tutorial.svelte';
const framework_order = ["React", "Vue", "SvelteKit", "Stripe", "Refine"];
const framework_order = ['React', 'Vue', 'SvelteKit', 'Stripe', 'Refine'];
const category_order = [
"Web",
"Mobile and native",
"Server",
"Auth",
"Databases",
"Storage",
"Functions",
'Web',
'Mobile and native',
'Server',
'Auth',
'Databases',
'Storage',
'Functions'
];
export async function load() {
const tutorialsGlob = import.meta.glob("./**/step-1/+page.markdoc", {
eager: true,
});
const allTutorials = Object.entries(tutorialsGlob)
.map(([filepath, tutorialList]: [string, unknown]) => {
const { frontmatter } = tutorialList as {
frontmatter: Tutorial;
};
const slug = filepath
.replace("./", "")
.replace("/+page.markdoc", "")
.replace("/step-1", "");
const tutorialName = slug.slice(slug.lastIndexOf("/") + 1);
return {
title: frontmatter.title,
framework: frontmatter.framework,
draft: frontmatter.draft || false,
category: frontmatter.category,
href: `${base}/docs/tutorials/${tutorialName}`,
};
})
.filter((tutorial) => !tutorial.draft)
.sort((a, b) => {
// Sort by framework order
const frameworkIndexA = framework_order.indexOf(a.framework as string);
const frameworkIndexB = framework_order.indexOf(b.framework as string);
if (frameworkIndexA > frameworkIndexB) {
return 1;
}
if (frameworkIndexA < frameworkIndexB) {
return -1;
}
// Else, sort by title
return a.title.toLowerCase().localeCompare(b.title.toLowerCase());
const tutorialsGlob = import.meta.glob('./**/step-1/+page.markdoc', {
eager: true
});
const tutorials = Object.entries(
allTutorials.reduce((acc: { [key: string]: any[] }, item) => {
// If the category does not exist in the accumulator, initialize it
if (!acc[item.category]) {
acc[item.category] = [];
}
const allTutorials = Object.entries(tutorialsGlob)
.map(([filepath, tutorialList]: [string, unknown]) => {
const { frontmatter } = tutorialList as {
frontmatter: Tutorial;
};
const slug = filepath
.replace('./', '')
.replace('/+page.markdoc', '')
.replace('/step-1', '');
const tutorialName = slug.slice(slug.lastIndexOf('/') + 1);
// Push the current item into the appropriate category
acc[item.category].push(item);
return {
title: frontmatter.title,
framework: frontmatter.framework,
draft: frontmatter.draft || false,
category: frontmatter.category,
href: `${base}/docs/tutorials/${tutorialName}`
};
})
.filter((tutorial) => !tutorial.draft)
.sort((a, b) => {
// Sort by framework order
const frameworkIndexA = framework_order.indexOf(a.framework as string);
const frameworkIndexB = framework_order.indexOf(b.framework as string);
return acc;
}, {}),
).map(([title, tutorials]) => ({ title, tutorials }));
if (frameworkIndexA > frameworkIndexB) {
return 1;
}
if (frameworkIndexA < frameworkIndexB) {
return -1;
}
tutorials.sort(
(a, b) => category_order.indexOf(a.title) - category_order.indexOf(b.title),
);
return {
tutorials,
};
// Else, sort by title
return a.title.toLowerCase().localeCompare(b.title.toLowerCase());
});
const tutorials = Object.entries(
allTutorials.reduce((acc: { [key: string]: any[] }, item) => {
// If the category does not exist in the accumulator, initialize it
if (!acc[item.category]) {
acc[item.category] = [];
}
// Push the current item into the appropriate category
acc[item.category].push(item);
return acc;
}, {})
).map(([title, tutorials]) => ({ title, tutorials }));
tutorials.sort((a, b) => category_order.indexOf(a.title) - category_order.indexOf(b.title));
return {
tutorials
};
}

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/android/step-1");
redirect(303, '/docs/tutorials/android/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/apple/step-1");
redirect(303, '/docs/tutorials/apple/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,5 +1,5 @@
import { redirect } from "@sveltejs/kit";
import { redirect } from '@sveltejs/kit';
export async function load() {
redirect(303, "/docs/tutorials/astro-ssr-auth/step-1");
redirect(303, '/docs/tutorials/astro-ssr-auth/step-1');
}

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/flutter/step-1");
redirect(303, '/docs/tutorials/flutter/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,5 +1,5 @@
import { redirect } from "@sveltejs/kit";
import { redirect } from '@sveltejs/kit';
export function load() {
redirect(303, "/docs/tutorials/nextjs-ssr-auth/step-1");
redirect(303, '/docs/tutorials/nextjs-ssr-auth/step-1');
}

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,5 +1,5 @@
import { redirect } from "@sveltejs/kit";
import { redirect } from '@sveltejs/kit';
export function load() {
redirect(303, "/docs/tutorials/nuxt-ssr-auth/step-1");
redirect(303, '/docs/tutorials/nuxt-ssr-auth/step-1');
}

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/nuxt/step-1");
redirect(303, '/docs/tutorials/nuxt/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/react-native/step-1");
redirect(303, '/docs/tutorials/react-native/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/react/step-1");
redirect(303, '/docs/tutorials/react/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/refine/step-1");
redirect(303, '/docs/tutorials/refine/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/subscriptions-with-stripe/step-1");
redirect(303, '/docs/tutorials/subscriptions-with-stripe/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/sveltekit-csr-auth/step-1");
redirect(303, '/docs/tutorials/sveltekit-csr-auth/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,5 +1,5 @@
import { redirect } from "@sveltejs/kit";
import { redirect } from '@sveltejs/kit';
export function load() {
redirect(303, "/docs/tutorials/sveltekit-ssr-auth/step-1");
redirect(303, '/docs/tutorials/sveltekit-ssr-auth/step-1');
}

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/sveltekit/step-1");
redirect(303, '/docs/tutorials/sveltekit/step-1');
};

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import { globToTutorial } from "$lib/utils/tutorials.js";
import { setContext } from "svelte";
import { globToTutorial } from '$lib/utils/tutorials.js';
import { setContext } from 'svelte';
export let data;
const tutorials = globToTutorial(data);
setContext("tutorials", tutorials);
export let data;
const tutorials = globToTutorial(data);
setContext('tutorials', tutorials);
</script>
<slot />

View File

@@ -1,11 +1,11 @@
import type { LayoutLoad } from "./$types";
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = ({ url }) => {
const tutorials = import.meta.glob("./**/*.markdoc", {
eager: true,
});
return {
tutorials,
pathname: url.pathname,
};
const tutorials = import.meta.glob('./**/*.markdoc', {
eager: true
});
return {
tutorials,
pathname: url.pathname
};
};

View File

@@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
redirect(303, "/docs/tutorials/vue/step-1");
redirect(303, '/docs/tutorials/vue/step-1');
};