mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 06:15:15 +00:00
shuffle things around
This commit is contained in:
14
site/src/routes/migrating/index.json.js
Normal file
14
site/src/routes/migrating/index.json.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import send from '@polka/send';
|
||||
import generate_docs from '../../utils/generate_docs.js';
|
||||
|
||||
let json;
|
||||
|
||||
export function get(req, res) {
|
||||
if (!json || process.env.NODE_ENV !== 'production') {
|
||||
json = JSON.stringify(generate_docs('migrating')); // TODO it errors if I send the non-stringified value
|
||||
}
|
||||
|
||||
send(res, 200, json, {
|
||||
'Content-Type': 'application/json'
|
||||
});
|
||||
}
|
||||
22
site/src/routes/migrating/index.svelte
Normal file
22
site/src/routes/migrating/index.svelte
Normal file
@@ -0,0 +1,22 @@
|
||||
<script context="module">
|
||||
export async function preload() {
|
||||
const sections = await this.fetch(`migrating.json`).then(r => r.json());
|
||||
return { sections };
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { Docs } from '@sveltejs/site-kit'
|
||||
|
||||
export let sections;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Migration • Sapper</title>
|
||||
|
||||
<meta name="twitter:title" content="Sapper migration guides">
|
||||
<meta name="twitter:description" content="The next small thing in web development">
|
||||
<meta name="Description" content="The next small thing in web development">
|
||||
</svelte:head>
|
||||
|
||||
<Docs {sections}/>
|
||||
Reference in New Issue
Block a user