├── cypress.json
├── netlify.toml
├── .gitignore
├── static
├── favicon.png
├── logo-192.png
├── logo-512.png
├── profile-pic.png
├── fonts
│ ├── rubik-latin-300.woff
│ ├── rubik-latin-300.woff2
│ ├── rubik-latin-400.woff
│ ├── rubik-latin-400.woff2
│ ├── rubik-latin-500.woff
│ ├── rubik-latin-500.woff2
│ ├── rubik-latin-700.woff
│ ├── rubik-latin-700.woff2
│ ├── rubik-latin-900.woff
│ ├── rubik-latin-900.woff2
│ ├── merriweather-latin-300.woff
│ ├── merriweather-latin-400.woff
│ ├── merriweather-latin-700.woff
│ ├── merriweather-latin-900.woff
│ ├── rubik-latin-300italic.woff
│ ├── rubik-latin-300italic.woff2
│ ├── rubik-latin-400italic.woff
│ ├── rubik-latin-400italic.woff2
│ ├── rubik-latin-500italic.woff
│ ├── rubik-latin-500italic.woff2
│ ├── rubik-latin-700italic.woff
│ ├── rubik-latin-700italic.woff2
│ ├── rubik-latin-900italic.woff
│ ├── rubik-latin-900italic.woff2
│ ├── merriweather-latin-300.woff2
│ ├── merriweather-latin-400.woff2
│ ├── merriweather-latin-700.woff2
│ ├── merriweather-latin-900.woff2
│ ├── merriweather-latin-300italic.woff
│ ├── merriweather-latin-300italic.woff2
│ ├── merriweather-latin-400italic.woff
│ ├── merriweather-latin-400italic.woff2
│ ├── merriweather-latin-700italic.woff
│ ├── merriweather-latin-700italic.woff2
│ ├── merriweather-latin-900italic.woff
│ └── merriweather-latin-900italic.woff2
├── rsz_florian-klauer-489-unsplash.jpg
├── manifest.json
├── global.css
├── highlight.css
├── fonts.css
└── undraw-illustration.svg
├── src
├── client.js
├── components
│ ├── Logo.svelte
│ ├── Header.svelte
│ ├── Bio.svelte
│ └── Nav.svelte
├── routes
│ ├── blog
│ │ ├── _posts.js
│ │ ├── posts
│ │ │ ├── hello-world.md
│ │ │ └── markdown-test.md
│ │ ├── index.json.js
│ │ ├── [slug].json.js
│ │ ├── index.svelte
│ │ └── [slug].svelte
│ ├── _error.svelte
│ ├── _layout.svelte
│ ├── index.svelte
│ └── about.svelte
├── server.js
├── template.html
├── utils
│ └── markdown.js
└── service-worker.js
├── cypress
├── fixtures
│ └── example.json
├── integration
│ └── spec.js
├── plugins
│ └── index.js
└── support
│ ├── index.js
│ └── commands.js
├── appveyor.yml
├── LICENSE
├── package.json
├── README.md
└── rollup.config.js
/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseUrl": "http://localhost:3000",
3 | "video": false
4 | }
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | publish = "__sapper__/export"
3 | command = "npm run export"
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | yarn-error.log
4 | /cypress/screenshots/
5 | /__sapper__/
6 |
--------------------------------------------------------------------------------
/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/favicon.png
--------------------------------------------------------------------------------
/static/logo-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/logo-192.png
--------------------------------------------------------------------------------
/static/logo-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/logo-512.png
--------------------------------------------------------------------------------
/static/profile-pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/profile-pic.png
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-300.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-300.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-300.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-300.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-400.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-400.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-500.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-500.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-500.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-500.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-700.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-700.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-700.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-900.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-900.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-900.woff2
--------------------------------------------------------------------------------
/src/client.js:
--------------------------------------------------------------------------------
1 | import * as sapper from '@sapper/app';
2 |
3 | sapper.start({
4 | target: document.querySelector('#sapper')
5 | });
6 |
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-300.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-300.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-400.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-700.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-900.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-900.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-300italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-300italic.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-300italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-300italic.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-400italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-400italic.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-400italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-400italic.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-500italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-500italic.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-500italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-500italic.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-700italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-700italic.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-700italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-700italic.woff2
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-900italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-900italic.woff
--------------------------------------------------------------------------------
/static/fonts/rubik-latin-900italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/rubik-latin-900italic.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-300.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-300.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-400.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-700.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-700.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-900.woff2
--------------------------------------------------------------------------------
/static/rsz_florian-klauer-489-unsplash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/rsz_florian-klauer-489-unsplash.jpg
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-300italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-300italic.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-300italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-300italic.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-400italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-400italic.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-400italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-400italic.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-700italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-700italic.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-700italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-700italic.woff2
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-900italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-900italic.woff
--------------------------------------------------------------------------------
/static/fonts/merriweather-latin-900italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Charca/sapper-blog-template/HEAD/static/fonts/merriweather-latin-900italic.woff2
--------------------------------------------------------------------------------
/cypress/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io",
4 | "body": "Fixtures are a great way to mock data for responses to routes"
5 | }
--------------------------------------------------------------------------------
/src/components/Logo.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/routes/blog/_posts.js:
--------------------------------------------------------------------------------
1 | import all from './posts/*.md';
2 |
3 | export default all
4 | .map((post) => ({ ...post, html: post.html.replace(/^\t{3}/gm, '') }))
5 | .sort((a, b) => new Date(b.date) - new Date(a.date));
6 |
--------------------------------------------------------------------------------
/src/routes/blog/posts/hello-world.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hello World 👋
3 | date: "2019-06-11T08:38:00.000Z"
4 | ---
5 |
6 | Every blog starts with a single post. This is yours. Make it great.
7 |
8 |
9 |
10 | This post intentionally left blank.
11 |
12 | Write what you want.
13 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: "{build}"
2 |
3 | shallow_clone: true
4 |
5 | init:
6 | - git config --global core.autocrlf false
7 |
8 | build: off
9 |
10 | environment:
11 | matrix:
12 | # node.js
13 | - nodejs_version: stable
14 |
15 | install:
16 | - ps: Install-Product node $env:nodejs_version
17 | - npm install
18 |
--------------------------------------------------------------------------------
/src/components/Header.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
{error.message}
37 | 38 | {#if dev && error.stack} 39 |{error.stack}
40 | {/if}
41 |
--------------------------------------------------------------------------------
/src/routes/blog/[slug].json.js:
--------------------------------------------------------------------------------
1 | import posts from './_posts.js';
2 |
3 | const lookup = new Map();
4 | posts.forEach(post => {
5 | lookup.set(post.slug, JSON.stringify(post));
6 | });
7 |
8 | export function get(req, res, next) {
9 | // the `slug` parameter is available because
10 | // this file is called [slug].json.js
11 | const { slug } = req.params;
12 |
13 | if (lookup.has(slug)) {
14 | res.writeHead(200, {
15 | 'Content-Type': 'application/json'
16 | });
17 |
18 | res.end(lookup.get(slug));
19 | } else {
20 | res.writeHead(404, {
21 | 'Content-Type': 'application/json'
22 | });
23 |
24 | res.end(JSON.stringify({
25 | message: `Not found`
26 | }));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/cypress/plugins/index.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example plugins/index.js can be used to load plugins
3 | //
4 | // You can change the location of this file or turn off loading
5 | // the plugins file with the 'pluginsFile' configuration option.
6 | //
7 | // You can read more here:
8 | // https://on.cypress.io/plugins-guide
9 | // ***********************************************************
10 |
11 | // This function is called when a project is opened or re-opened (e.g. due to
12 | // the project's config changing)
13 |
14 | module.exports = (on, config) => {
15 | // `on` is used to hook into various events Cypress emits
16 | // `config` is the resolved Cypress config
17 | }
18 |
--------------------------------------------------------------------------------
/cypress/support/index.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands'
18 |
19 | // Alternatively you can use CommonJS syntax:
20 | // require('./commands')
21 |
--------------------------------------------------------------------------------
/src/components/Bio.svelte:
--------------------------------------------------------------------------------
1 |
20 |
21 |
23 | 24 | Hi, I'm Maxi. I'm a software engineer and data scientist from Córdoba, Argentina. 25 | You can follow me on Twitter, 26 | see some of my work on GitHub, 27 | or read more about me on my website. 28 |
29 |{post.excerpt}
47 | 50 |Check out the docs on GitHub to get started.
71 |
28 | Text placeholder via Jeffsum.
31 |So you two dig up, dig up dinosaurs? What do they got in there? King Kong? My dad once told me, laugh and the world laughs with you, Cry, and I'll give you something to cry about you little bastard! Life finds a way. God creates dinosaurs. God destroys dinosaurs. God creates Man. Man destroys God. Man creates Dinosaurs.
32 |You really think you can fly that thing? You know what? It is beets. I've crashed into a beet truck. Forget the fat lady! You're obsessed with the fat lady! Drive us out of here! Is this my espresso machine? Wh-what is-h-how did you get my espresso machine?
33 |Hey, you know how I'm, like, always trying to save the planet? Here's my chance. Hey, take a look at the earthlings. Goodbye! I was part of something special. Just my luck, no ice. You're a very talented young man, with your own clever thoughts and ideas. Do you need a manager?
34 |Jaguar shark! So tell me - does it really exist? This thing comes fully loaded. AM/FM radio, reclining bucket seats, and... power windows. Yes, Yes, without the oops! You're a very talented young man, with your own clever thoughts and ideas. Do you need a manager?
35 |Yes, Yes, without the oops! Do you have any idea how long it takes those cups to decompose. They're using our own satellites against us. And the clock is ticking. Do you have any idea how long it takes those cups to decompose. My dad once told me, laugh and the world laughs with you, Cry, and I'll give you something to cry about you little bastard!
36 |${highlighted}`;
36 | };
37 |
38 | marked.setOptions({ renderer });
39 |
40 | export default () => ({
41 | transform(md, id) {
42 | if (!/\.md$/.test(id)) return null;
43 |
44 | const fileName = path.basename(id);
45 | const { data, content: rawContent } = matter(md);
46 | const { title, date } = data;
47 | const slug = fileName.split('.')[0];
48 | let content = rawContent;
49 | let excerpt = '';
50 |
51 | if (rawContent.indexOf(EXCERPT_SEPARATOR) !== -1) {
52 | const splittedContent = rawContent.split(EXCERPT_SEPARATOR);
53 | excerpt = splittedContent[0];
54 | content = splittedContent[1];
55 | }
56 |
57 | const html = marked(content);
58 | const readingStats = readingTime(content);
59 | const printReadingTime = readingStats.text;
60 | const printDate = formatDate(new Date(date), 'MMMM D, YYYY');
61 |
62 | const exportFromModule = JSON.stringify({
63 | title: title || slug,
64 | slug,
65 | html,
66 | date,
67 | excerpt,
68 | printDate,
69 | printReadingTime,
70 | });
71 |
72 | return {
73 | code: `export default ${exportFromModule}`,
74 | map: { mappings: '' },
75 | };
76 | },
77 | });
78 |
--------------------------------------------------------------------------------
/src/service-worker.js:
--------------------------------------------------------------------------------
1 | import { timestamp, files, shell, routes } from '@sapper/service-worker';
2 |
3 | const ASSETS = `cache${timestamp}`;
4 |
5 | // `shell` is an array of all the files generated by the bundler,
6 | // `files` is an array of everything in the `static` directory
7 | const to_cache = shell.concat(files);
8 | const cached = new Set(to_cache);
9 |
10 | self.addEventListener('install', event => {
11 | event.waitUntil(
12 | caches
13 | .open(ASSETS)
14 | .then(cache => cache.addAll(to_cache))
15 | .then(() => {
16 | self.skipWaiting();
17 | })
18 | );
19 | });
20 |
21 | self.addEventListener('activate', event => {
22 | event.waitUntil(
23 | caches.keys().then(async keys => {
24 | // delete old caches
25 | for (const key of keys) {
26 | if (key !== ASSETS) await caches.delete(key);
27 | }
28 |
29 | self.clients.claim();
30 | })
31 | );
32 | });
33 |
34 | self.addEventListener('fetch', event => {
35 | if (event.request.method !== 'GET' || event.request.headers.has('range')) return;
36 |
37 | const url = new URL(event.request.url);
38 |
39 | // don't try to handle e.g. data: URIs
40 | if (!url.protocol.startsWith('http')) return;
41 |
42 | // ignore dev server requests
43 | if (url.hostname === self.location.hostname && url.port !== self.location.port) return;
44 |
45 | // always serve static files and bundler-generated assets from cache
46 | if (url.host === self.location.host && cached.has(url.pathname)) {
47 | event.respondWith(caches.match(event.request));
48 | return;
49 | }
50 |
51 | // for pages, you might want to serve a shell `service-worker-index.html` file,
52 | // which Sapper has generated for you. It's not right for every
53 | // app, but if it's right for yours then uncomment this section
54 | /*
55 | if (url.origin === self.origin && routes.find(route => route.pattern.test(url.pathname))) {
56 | event.respondWith(caches.match('/service-worker-index.html'));
57 | return;
58 | }
59 | */
60 |
61 | if (event.request.cache === 'only-if-cached') return;
62 |
63 | // for everything else, try the network first, falling back to
64 | // cache if the user is offline. (If the pages never change, you
65 | // might prefer a cache-first approach to a network-first one.)
66 | event.respondWith(
67 | caches
68 | .open(`offline${timestamp}`)
69 | .then(async cache => {
70 | try {
71 | const response = await fetch(event.request);
72 | cache.put(event.request, response.clone());
73 | return response;
74 | } catch(err) {
75 | const response = await cache.match(event.request);
76 | if (response) return response;
77 |
78 | throw err;
79 | }
80 | })
81 | );
82 | });
83 |
--------------------------------------------------------------------------------
/src/routes/blog/[slug].svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
20 |
21 |
42 |
43 | {post.printDate} ~ {post.printReadingTime}
87 |165 | Getting a new business off the ground is a lot of hard work. Here are five 166 | ideas you can use to find your first customers. 167 |
168 |