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 @@ - -
  • blog
  • diff --git a/routes/api/blog/[slug].js b/routes/api/blog/[slug].js deleted file mode 100644 index f1a151fe..00000000 --- a/routes/api/blog/[slug].js +++ /dev/null @@ -1,22 +0,0 @@ -import posts from './_posts.js'; - -const lookup = new Map(); -posts.forEach(post => { - lookup.set(post.slug, JSON.stringify(post)); -}); - -export function get(req, res, next) { - // the `slug` parameter is available because this file - // is called [slug].js - const { slug } = req.params; - - if (lookup.has(slug)) { - res.set({ - 'Content-Type': 'application/json' - }); - - res.end(lookup.get(slug)); - } else { - next(); - } -} diff --git a/routes/api/blog/_posts.js b/routes/api/blog/_posts.js deleted file mode 100644 index 7fe65c5b..00000000 --- a/routes/api/blog/_posts.js +++ /dev/null @@ -1,92 +0,0 @@ -// Ordinarily, you'd generate this data from markdown files in your -// repo, or fetch them from a database of some kind. But in order to -// avoid unnecessary dependencies in the starter template, and in the -// service of obviousness, we're just going to leave it here. - -// This file is called `_posts.js` rather than `posts.js`, because -// we don't want to create an `/api/blog/posts` route — the leading -// underscore tells Sapper not to do that. - -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!

    - -

    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: ` -

    Step one

    -

    Create a new project, using degit:

    - -
    npx degit sveltejs/sapper-template 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.

    - -

    Step three

    -

    ...

    - -

    Step four

    -

    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:

    - - - ` - }, - - { - 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 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> - {{post.title}} - - - -

    {{post.title}}

    - -
    - {{{post.html}}} -
    -
    - - - - \ No newline at end of file diff --git a/routes/blog/index.html b/routes/blog/index.html deleted file mode 100644 index 16ff29e3..00000000 --- a/routes/blog/index.html +++ /dev/null @@ -1,40 +0,0 @@ -<:Head> - Blog - - - -

    Recent posts

    - - -
    - - - - \ No newline at end of file