diff --git a/routes/_components/Nav.html b/routes/_components/Nav.html index c7f6fd95..a942d005 100644 --- a/routes/_components/Nav.html +++ b/routes/_components/Nav.html @@ -25,9 +25,6 @@ - -
First, you have to know what Svelte is. Svelte is a UI framework with a bold new idea: rather than providing a library that you write code with (like React or Vue, for example), it's a compiler that turns your components into highly optimized vanilla JavaScript. If you haven't already read the introductory blog post, you should!
- -Sapper is a Next.js-style framework (more on that here) built around Svelte. It makes it embarrassingly easy to create extremely high performance web apps. Out of the box, you get:
- -It's implemented as Express middleware. Everything is set up and waiting for you to get started, but you keep complete control over the server, service worker, webpack config and everything else, so it's as flexible as you need it to be.
- ` - }, - - { - title: 'How to use Sapper', - slug: 'how-to-use-sapper', - html: ` -Create a new project, using degit:
- -npx degit sveltejs/sapper-template my-app
- cd my-app
- npm install # or yarn!
- npm run dev
-
-
- Go to localhost:3000. Open my-app
in your editor. Edit the files in the routes
directory or add new ones.
...
- -Resist overdone joke formats.
- ` - }, - - { - title: 'Why the name?', - slug: 'why-the-name', - html: ` -In war, the soldiers who build bridges, repair roads, clear minefields and conduct demolitions — all under combat conditions — are known as sappers.
- -For web developers, the stakes are generally lower than those for combat engineers. But we face our own hostile environment: underpowered devices, poor network connections, and the complexity inherent in front-end engineering. Sapper, which is short for Svelte app maker, is your courageous and dutiful ally.
- ` - }, - - { - title: 'How is Sapper different from Next.js?', - slug: 'how-is-sapper-different-from-next', - html: ` -Next.js is a React framework from Zeit, and is the inspiration for Sapper. There are a few notable differences, however:
- -routes/blog/[slug].html
routes
directory. These are just .js
files that export functions corresponding to HTTP methods, and receive Express request
and response
objects as arguments. This makes it very easy to, for example, add a JSON API such as the one powering this very page (look in routes/api/blog
)<a>
elements, rather than framework-specific <Link>
components. That means, for example, that this link right here, despite being inside a blob of HTML, works with the router as you'd expect.We're so glad you asked! Come on over to the Svelte and Sapper repos, and join us in the Gitter chatroom. Everyone is welcome, especially you!
- ` - } -]; - -posts.forEach(post => { - post.html = post.html.replace(/^\t{3}/gm, ''); -}); - -export default posts; \ No newline at end of file diff --git a/routes/api/blog/index.js b/routes/api/blog/index.js deleted file mode 100644 index 4c107887..00000000 --- a/routes/api/blog/index.js +++ /dev/null @@ -1,16 +0,0 @@ -import posts from './_posts.js'; - -const contents = JSON.stringify(posts.map(post => { - return { - title: post.title, - slug: post.slug - }; -})); - -export function get(req, res) { - res.set({ - 'Content-Type': 'application/json' - }); - - res.end(contents); -} \ No newline at end of file diff --git a/routes/blog/[slug].html b/routes/blog/[slug].html deleted file mode 100644 index 26469300..00000000 --- a/routes/blog/[slug].html +++ /dev/null @@ -1,67 +0,0 @@ -<:Head> -