From 27be067a82b5d4d829b6e833a3768cb12d342fff Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sat, 11 May 2019 07:22:03 -0400 Subject: [PATCH] update URLs and paths in blog posts --- src/routes/blog/_posts.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/blog/_posts.js b/src/routes/blog/_posts.js index 698e369..c75a1f4 100644 --- a/src/routes/blog/_posts.js +++ b/src/routes/blog/_posts.js @@ -12,7 +12,7 @@ const posts = [ title: 'What is Sapper?', slug: 'what-is-sapper', html: ` -

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!

+

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:

@@ -34,14 +34,14 @@ const posts = [

Step one

Create a new project, using degit:

-
npx degit sveltejs/sapper-template my-app
+			
npx degit sveltejs/sapper-template#rollup my-app
 			cd my-app
 			npm install # or yarn!
 			npm run dev
 			

Step two

-

Go to localhost:3000. Open my-app in your editor. Edit the files in the routes directory or add new ones.

+

Go to localhost:3000. Open my-app in your editor. Edit the files in the src/routes directory or add new ones.

Step three

...

@@ -65,11 +65,11 @@ const posts = [ 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:

+

Next.js is a React framework from Zeit, and is the inspiration for Sapper. There are a few notable differences, however:

    -
  • It's powered by Svelte instead of React, so it's faster and your apps are smaller
  • -
  • Instead of route masking, we encode route parameters in filenames. For example, the page you're looking at right now is routes/blog/[slug].html
  • +
  • It's powered by Svelte instead of React, so it's faster and your apps are smaller
  • +
  • Instead of route masking, we encode route parameters in filenames. For example, the page you're looking at right now is src/routes/blog/[slug].html
  • As well as pages (Svelte components, which render on server or client), you can create server routes in your 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
  • Links are just <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.
@@ -80,7 +80,7 @@ const posts = [ title: 'How can I get involved?', slug: 'how-can-i-get-involved', html: ` -

We're so glad you asked! Come on over to the Svelte and Sapper repos, and join us in the Discord chatroom. Everyone is welcome, especially you!

+

We're so glad you asked! Come on over to the Svelte and Sapper repos, and join us in the Discord chatroom. Everyone is welcome, especially you!

` } ]; @@ -89,4 +89,4 @@ posts.forEach(post => { post.html = post.html.replace(/^\t{3}/gm, ''); }); -export default posts; \ No newline at end of file +export default posts;