├── .npmrc ├── static └── favicon.png ├── .gitignore ├── src ├── styles │ ├── reset.css │ └── globals.css ├── lib │ ├── prismicio.js │ └── nav.svelte ├── app.html └── routes │ ├── index.js │ ├── [uid].js │ ├── __layout.svelte │ ├── [uid].svelte │ └── index.svelte ├── netlify.toml ├── svelte.config.js ├── jsconfig.json ├── README.md └── package.json /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samlfair/svelte-tutorial/HEAD/static/favicon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | -------------------------------------------------------------------------------- /src/styles/reset.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | } 9 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run build" 3 | publish = "build" 4 | 5 | [functions] 6 | node_bundler = "esbuild" -------------------------------------------------------------------------------- /svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-auto'; 2 | 3 | /** @type {import('@sveltejs/kit').Config} */ 4 | const config = { 5 | kit: { 6 | adapter: adapter() 7 | } 8 | }; 9 | 10 | export default config; 11 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "$lib": ["src/lib"], 6 | "$lib/*": ["src/lib/*"] 7 | } 8 | }, 9 | "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] 10 | } 11 | -------------------------------------------------------------------------------- /src/styles/globals.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | } 4 | 5 | .container { 6 | display: flex; 7 | flex-direction: column; 8 | align-items: center; 9 | padding: 0px 20px; 10 | } 11 | 12 | .container > * { 13 | width: 100%; 14 | max-width: 700px; 15 | } 16 | -------------------------------------------------------------------------------- /src/lib/prismicio.js: -------------------------------------------------------------------------------- 1 | import * as prismic from '@prismicio/client' 2 | 3 | // Update your repository name here 4 | const repositoryName = 'svelte-tutorial' 5 | 6 | const createClient = (params) => { 7 | return prismic.createClient(repositoryName, params) 8 | } 9 | 10 | export default createClient 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Svelte Tutorial Example Repo 2 | 3 | [See this project live](https://lucid-murdock-988f01.netlify.app/). 4 | 5 | Want to learn Svelte and SvelteKit? Check out [this tutorial](https://prismic.io/blog/svelte-sveltekit-tutorial). 6 | 7 | This repo is the final product of the above tutorial. It is a two-page website using Svelte and Sveltekit with content managed in Prismic. 8 | -------------------------------------------------------------------------------- /src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | %svelte.head% 9 | 10 | 11 |