This repo is being archived as sveltekit should be used in favor of sapper as of this writing.
An expansion of the default Sapper template in the following ways:
- blog posts are generated from markdown files in
content/posts
- pages are able to be built from markdown files in
content/pages
- netlify cms allows for editing of both blog posts and markdown source pages
degit
is a scaffolding tool that lets you create a directory from a branch in a repository. Use either the rollup
or webpack
branch in sapper-template
:
npx degit "edm00se/sapper-md-netlify-cms-starter" my-app
Alternatively, you can use GitHub's template feature with the sapper-template-rollup repository.
However you get the code, you can install dependencies and run the project in development mode with:
cd my-app
npm install
npm run dev
Open up localhost:3000 and start clicking around.
Consult sapper.svelte.dev for help getting started.
You should at a minimum update:
- the
name
anddescription
fields inpackage.json
- the
backend
'srepo
andbranch
fields instatic/admin/config.yml
to ensure the netlify cms changes go the correct destination - the
siteUrl
andsiteTitle
insrc/stores/_config.js
Sapper expects to find three directories in the root of your project — src
, static
, and content
. The content
directory contains pages and blog posts in markdown files in their respective sub-directories, static
is any static assets that need to be served, and src
contains the majority of the sapper application.
Of note:
- change the
siteUrl
insrc/stores/_config.js
- blog functionality is in
src/routes/blog/
- pages in
src/routes/
, other than the home page (index.svelte
), are generated via[slug].json.js
and[slug].svelte
This Sapper starter uses Rollup to provide code-splitting and dynamic imports, as well as compiling your Svelte components.
As it exists in this repo, you can export with npm run export
and publish the contents of __sapper__/export
.
MIT