-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9183cd8
Showing
85 changed files
with
11,545 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore files for PNPM, NPM and YARN | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"printWidth": 100, | ||
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], | ||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Prismic + SvelteKit Minimal Starter | ||
|
||
Want to quickly get started building your own project with [Prismic][prismic] and [SvelteKit][sveltekit]? This project includes basic configurations and nothing else. The project includes one Rich Text Slice, a homepage, and a dynamic page. | ||
|
||
- **Demo**: [Open live demo][live-demo] | ||
- **Learn more about Prismic and SvelteKit**: [Prismic SvelteKit Documentation][prismic-docs] | ||
|
||
| ||
|
||
 | ||
|
||
| ||
|
||
## 🚀 Quick Start | ||
|
||
To start a new project using this starter, run the following commands in your terminal: | ||
|
||
```sh | ||
npx @slicemachine/init@latest --starter sveltekit-starter-prismic-minimal | ||
``` | ||
|
||
The commands will do the following: | ||
|
||
1. Start a new SvelteKit project using this starter. | ||
2. Ask you to log in to Prismic or [create an account][prismic-sign-up]. | ||
3. Create a new Prismic content repository with sample content. | ||
|
||
When you're ready to start your project, run the following command: | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
|
||
## How to use your project | ||
|
||
To edit the content of this project, go to [prismic.io/dashboard](https://prismic.io/dashboard), click on the repository for this website, and start editing. | ||
|
||
### Create a page | ||
|
||
To create a page, click on the green pencil icon, then select **Page**. | ||
|
||
Pages are made of Slices. You can add and rearrange Slices to your pages. | ||
|
||
Your new page will be accessible by its URL, but it won't appear on the website automatically. To let users discover it, add it to the navigation. | ||
|
||
### Customize this website | ||
|
||
This website is preconfigured with Prismic. It has three Prismic packages installed: | ||
|
||
- `@prismicio/client` provides helpers for fetching content from Prismic | ||
- `@prismicio/svelte` provides Svelte components for rendering content from Prismic | ||
|
||
These packages are already integrated and employed in this app. Take a look at the code to see how they're used. | ||
|
||
### Edit the code | ||
|
||
There are two steps to rendering content from Prismic in your SvelteKit project: | ||
|
||
1. Fetch content from the Prismic API using `@prismicio/client`. | ||
2. Template the content using components from `@prismicio/svelte`. | ||
|
||
Here are some of the files in your project that you can edit: | ||
|
||
- `src/lib/prismicio.ts` - This file includes configuration for `@prismicio/client` and exports useful API helpers. | ||
- `src/routes/+layout.svelte` - This is your layout component. | ||
- `src/routes/+page.svelte` - This is the app homepage. It queries and renders a page document with the UID (unique identifier) "home" from the Prismic API. | ||
- `src/routes/[uid]/+page.svelte` - This is the page component, which queries and renders a page document from your Prismic repository based on the UID. | ||
- `src/lib/slices/*/index.svelte` - Each Slice in your project has an `index.svelte` file that renders the Slice component. Edit this file to customize your Slices. | ||
|
||
These are important files that you should leave as-is: | ||
|
||
- `src/routes/slice-simulator/+page.svelte` - Do not edit or delete this file. This file simulates your Slice components in development. | ||
- `src/lib/slices/` - This directory contains Slice components, which are generated programmatically by Slice Machine. To customize a Slice template, you can edit the Slice's `index.svelte` file. To add Slices, delete Slices, or edit Slice models, use Slice Machine (more info below). | ||
|
||
Learn more about how to edit your components with [Fetch Data in SvelteKit](https://prismic.io/docs/technologies/fetch-data-sveltekit) and [Template Content in SvelteKit](https://prismic.io/docs/technologies/template-content-sveltekit). | ||
|
||
### Deploy to the web | ||
|
||
To put your project online, see [Deploy your SvelteKit App](https://prismic.io/docs/technologies/deploy-sveltekit). | ||
|
||
### Edit content models with Slice Machine | ||
|
||
This project includes an application called Slice Machine, which generates models for your Custom Types and Slices. Slice Machine stores the models locally in your codebase, so you can save and version them. It also syncs your models to Prismic. To learn how to use Slice Machine, read [Model Content in SvelteKit](https://prismic.io/docs/technologies/model-content-sveltekit). | ||
|
||
If you change or add to your Custom Types, you'll need to update your route handling to match. To learn how to do that, read [Define Paths in SvelteKit](https://prismic.io/docs/technologies/define-paths-sveltekit). | ||
|
||
## Documentation | ||
|
||
For the official Prismic documentation, see [Prismic's guide for SvelteKit][prismic-docs] or the [technical references for the installed Prismic packages](https://prismic.io/docs/technologies/technical-references). | ||
|
||
## License | ||
|
||
``` | ||
Copyright 2013-2023 Prismic <[email protected]> (https://prismic.io) | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` | ||
|
||
[prismic]: https://prismic.io/ | ||
[prismic-docs]: https://prismic.io/docs/technologies/sveltekit | ||
[prismic-sign-up]: https://prismic.io/dashboard/signup | ||
[sveltekit]: https://kit.svelte.dev/ | ||
[live-demo]: https://sveltekit-starter-prismic-minimal.vercel.app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"format": "page", | ||
"id": "case_study", | ||
"label": "Case Study", | ||
"repeatable": true, | ||
"status": true, | ||
"json": { | ||
"Main": { | ||
"uid": { | ||
"config": { | ||
"label": "UID" | ||
}, | ||
"type": "UID" | ||
}, | ||
"company": { | ||
"type": "StructuredText", | ||
"config": { | ||
"label": "Company", | ||
"placeholder": "", | ||
"allowTargetBlank": true, | ||
"single": "heading1" | ||
} | ||
}, | ||
"description": { | ||
"type": "StructuredText", | ||
"config": { | ||
"label": "Description", | ||
"placeholder": "", | ||
"allowTargetBlank": true, | ||
"single": "paragraph" | ||
} | ||
}, | ||
"image": { | ||
"type": "Image", | ||
"config": { | ||
"label": "Image", | ||
"constraint": {}, | ||
"thumbnails": [] | ||
} | ||
}, | ||
"slices": { | ||
"type": "Slices", | ||
"fieldset": "Slice Zone", | ||
"config": { | ||
"choices": { | ||
"rich_text": { | ||
"type": "SharedSlice" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"SEO & Metadata": { | ||
"meta_title": { | ||
"config": { | ||
"label": "Meta Title", | ||
"placeholder": "A title of the page used for social media and search engines" | ||
}, | ||
"type": "Text" | ||
}, | ||
"meta_description": { | ||
"config": { | ||
"label": "Meta Description", | ||
"placeholder": "A brief summary of the page" | ||
}, | ||
"type": "Text" | ||
}, | ||
"meta_image": { | ||
"config": { | ||
"constraint": { | ||
"height": 1260, | ||
"width": 2400 | ||
}, | ||
"label": "Meta Image", | ||
"thumbnails": [] | ||
}, | ||
"type": "Image" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"id": "page", | ||
"label": "Page", | ||
"format": "page", | ||
"repeatable": true, | ||
"status": true, | ||
"json": { | ||
"Main": { | ||
"uid": { | ||
"type": "UID", | ||
"config": { | ||
"label": "UID", | ||
"placeholder": "" | ||
} | ||
}, | ||
"title": { | ||
"type": "StructuredText", | ||
"config": { | ||
"label": "Title", | ||
"placeholder": "", | ||
"allowTargetBlank": true, | ||
"single": "heading1" | ||
} | ||
}, | ||
"slices": { | ||
"type": "Slices", | ||
"fieldset": "Slice Zone", | ||
"config": { | ||
"choices": { | ||
"call_to_action": { | ||
"type": "SharedSlice" | ||
}, | ||
"integrations": { | ||
"type": "SharedSlice" | ||
}, | ||
"case_studies": { | ||
"type": "SharedSlice" | ||
}, | ||
"showcase": { | ||
"type": "SharedSlice" | ||
}, | ||
"bento": { | ||
"type": "SharedSlice" | ||
}, | ||
"hero": { | ||
"type": "SharedSlice" | ||
}, | ||
"rich_text": { | ||
"type": "SharedSlice" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"SEO & Metadata": { | ||
"meta_title": { | ||
"type": "Text", | ||
"config": { | ||
"label": "Meta Title", | ||
"placeholder": "A title of the page used for social media and search engines" | ||
} | ||
}, | ||
"meta_description": { | ||
"type": "Text", | ||
"config": { | ||
"label": "Meta Description", | ||
"placeholder": "A brief summary of the page" | ||
} | ||
}, | ||
"meta_image": { | ||
"type": "Image", | ||
"config": { | ||
"label": "Meta Image", | ||
"constraint": { | ||
"width": 2400, | ||
"height": 1260 | ||
}, | ||
"thumbnails": [] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[ | ||
{ | ||
"uid": { | ||
"__TYPE__": "UIDContent", | ||
"value": "four" | ||
}, | ||
"title": { | ||
"__TYPE__": "StructuredTextContent", | ||
"value": [ | ||
{ | ||
"type": "heading1", | ||
"content": { | ||
"text": "According" | ||
} | ||
} | ||
] | ||
}, | ||
"slices": { | ||
"__TYPE__": "SliceContentType", | ||
"value": [ | ||
{ | ||
"key": "rich_text$5ecec40d-becb-45bb-9538-ea1e11a3144f", | ||
"name": "rich_text", | ||
"widget": { | ||
"__TYPE__": "SharedSliceContent", | ||
"variation": "default", | ||
"primary": { | ||
"content": { | ||
"__TYPE__": "StructuredTextContent", | ||
"value": [ | ||
{ | ||
"type": "paragraph", | ||
"content": { | ||
"text": "Nostrud ad tempor fugiat officia minim elit commodo amet aliqua voluptate minim. Magna ut sit dolor laborum ex ut." | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"items": [ | ||
{ | ||
"__TYPE__": "GroupItemContent", | ||
"value": [] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
Oops, something went wrong.