<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Team Prismic</title>
    <description>The latest articles on DEV Community by Team Prismic (@teamprismic).</description>
    <link>https://dev.to/teamprismic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F5123%2F7cbb30df-21b4-4f10-9040-97921391886f.jpeg</url>
      <title>DEV Community: Team Prismic</title>
      <link>https://dev.to/teamprismic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/teamprismic"/>
    <language>en</language>
    <item>
      <title>May Monthly Recap: A Project I Loved Working On</title>
      <dc:creator>Grace Miller</dc:creator>
      <pubDate>Wed, 08 Jun 2022 19:06:35 +0000</pubDate>
      <link>https://dev.to/teamprismic/may-monthly-recap-a-project-i-loved-working-on-21im</link>
      <guid>https://dev.to/teamprismic/may-monthly-recap-a-project-i-loved-working-on-21im</guid>
      <description>&lt;p&gt;May was a really exciting month for me at &lt;a href="https://prismic.io?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;Prismic&lt;/a&gt;. 🤸‍♀️&lt;/p&gt;

&lt;p&gt;A few years ago, I transitioned from a career as a writer and editor to web development through a full-stack coding boot camp. It’s been a fun, but sometimes difficult journey. I have definitely struggled with imposter syndrome and more, but I’ve also found a lot of excitement in the fact that there’s always something new to explore as a developer. &lt;/p&gt;

&lt;p&gt;My work at Prismic has been an amazing way to bring both the content part of me and the developer part of me together. And in May, we launched a project that brought that synergy to a new level. 📈  I got to work with our team to bring my enjoyment of new things in web dev together with content creation in the best way: a coding challenge newsletter that helps you explore new tech. &lt;/p&gt;

&lt;p&gt;The best part about it, though, was the way that our team made this newsletter idea into something even better than I could have imagined on my own. After years of freelancing, that kind of collaboration adds a special sprinkle of joy to my work here. ☺️&lt;/p&gt;

&lt;p&gt;But enough about me. Here are some of the awesome pieces that our writers published in May! 👇&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/jamstack-vs-wordpress?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;The Jamstack Ecosystem vs. WordPress: Why and When to Switch&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;WordPress. It’s a dominant force in the world of web development, to be sure. But when innovations are on the horizon, the sheer number of users on a platform doesn’t necessarily make it the very best solution available. In particular, &lt;a href="https://prismic.io/blog/jamstack-vs-wordpress?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;comparing the Jamstack ecosystem (plus a headless CMS, of course) with WordPress&lt;/a&gt; can reveal a number of benefits for different projects. &lt;a href="https://twitter.com/MrConerMurphy"&gt;Coner&lt;/a&gt; did a great job of covering this comparison, and it’s worth a read whether it’s you or someone you work with who needs to be convinced that it’s time for a switch.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/best-web-development-news-sources?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;15 Awesome Web Development News Sources&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;As much as I love keeping up with new things in development, it can honestly be a bit overwhelming at times. I really love the &lt;a href="https://prismic.io/blog/best-web-development-news-sources?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;list of resources for web development news&lt;/a&gt; that &lt;a href="https://twitter.com/MrConerMurphy"&gt;Coner&lt;/a&gt; put together here. There’s something for everyone, no matter how you prefer to keep up with the news.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/coding-challenges-newsletter?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;The Optimized Dev Newsletter&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This is it! One of the most enjoyable projects I’ve ever gotten to work on. To quickly recap, it’s a &lt;a href="https://prismic.io/blog/coding-challenges-newsletter?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;coding challenge newsletter&lt;/a&gt; that helps developers explore new tech each month to stay on the leading edge of web development. You’ll see the first-ever challenge solution below, since we post the solution each month after our subscribers have had time to try it out on their own. Next month, we’re going to dip into Svelte!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/compare-react-vs-vue?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;Trying Vue as a React Developer: A Quick Introduction&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;So, when I talk about scaffolding in The Optimized Dev newsletter, this is what I mean. May’s challenge was all about trying out Pinia, which is set to be the default state management library for Vue 3. Not all of our subscribers are Vue developers, though, so we wanted to be sure to provide a little extra support so they could still join in the fun. &lt;a href="https://twitter.com/ajcwebdev"&gt;Anthony’s&lt;/a&gt; quick introduction &lt;a href="https://prismic.io/blog/compare-react-vs-vue?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;helps React developers understand the differences they’ll notice when trying Vue.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/slice-machine-empowers-developers?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;6 Ways Slice Machine Empowers Developers to Build Better Websites&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Here at Prismic, we have &lt;a href="https://prismic.io/blog/slice-machine-empowers-developers?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;a developer tool&lt;/a&gt; that we’re pretty fond of called Slice Machine. I think we love it so much because it really reflects something that we value as a company, which is delivering a great developer experience. Essentially Slice Machine is our tool for creating reusable components (Slices) for content teams to use in Prismic’s editing interface. It helps you by creating the models that Prismic’s API needs to configure the editor and store/send data, while also helping you with the boilerplate of coding components and connecting them to the API. There are a lot of benefits when using this tool, and I could keep talking about it for a while 😂 but &lt;a href="https://twitter.com/angeloashmore"&gt;Angelo&lt;/a&gt; did a great job highlighting them, so I’ll &lt;a href="https://prismic.io/blog/slice-machine-empowers-developers?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;let you read it from him&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/try-tutorial-vue-pinia?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;Give Pinia a Try: Build a Confetti Clicker Game with Us&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you want a try-before-you-buy preview of the Optimized Dev Newsletter, this tutorial is the solution to May’s coding challenge. Our subscribers built Pinia’s Party, a confetti clicker game that used Pinia to leverage stores. &lt;a href="https://twitter.com/li_hbr"&gt;Lucie&lt;/a&gt; did a great job of making this a truly fun project to help devs explore state management in Vue, and more specifically &lt;a href="https://prismic.io/blog/try-tutorial-vue-pinia?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;the default library for state management in Vue 3, Pinia&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/how-do-apis-work?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=destination_title"&gt;How Do APIs Work?&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I love this blog post. If you’re just getting into web development and you’re wondering &lt;a href="https://prismic.io/blog/how-do-apis-work"&gt;what APIs are and how they work&lt;/a&gt;, &lt;a href="https://twitter.com/samlfair?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=inline"&gt;Sam&lt;/a&gt; has given you a great place to start. There are great analogies, helpful illustrations, and a nice overview of all of the questions you might have starting out.&lt;/p&gt;

&lt;p&gt;I’ll be back next month to share what we’ve been working on and what I’ve been learning from all of the awesome people I get to collaborate with. In the meantime, happy coding! 🚀&lt;/p&gt;

</description>
      <category>vue</category>
      <category>jamstack</category>
      <category>api</category>
      <category>career</category>
    </item>
    <item>
      <title>An April 2022 Recap</title>
      <dc:creator>Grace Miller</dc:creator>
      <pubDate>Fri, 13 May 2022 21:59:34 +0000</pubDate>
      <link>https://dev.to/teamprismic/an-april-2022-recap-28ij</link>
      <guid>https://dev.to/teamprismic/an-april-2022-recap-28ij</guid>
      <description>&lt;p&gt;One of the coolest things I’ve observed while working at &lt;a href="https://prismic.io?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;Prismic&lt;/a&gt; is seeing how our headless website builder frees devs to do more of what they enjoy. When devs master building with Slices (aka website sections), they can ship a custom website builder experience to their content teams, and then spend their time building and optimizing. They’re not constantly bogged down with requests from content teams or, worse still, broken stuff to fix and maintain. &lt;/p&gt;

&lt;p&gt;With that in mind, we’re creating content that helps developers step into and explore something they love to work on: optimization. &lt;/p&gt;

&lt;p&gt;I get to work with awesome developers to pull this content together, and I’m really proud of all they’ve been doing. Our new motto is that the Prismic blog is a place where devs can go to optimize their skills, stacks, and careers. Here’s a quick round-up of what we published in April:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/6-thoughts-building-a-career-in-web-development?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;6 Thoughts on Building a Career in Web Development&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Okay, this one came out a little before April, but how could I know about a blog with career advice from Cassidy Williams and not share that with you? From community to your personal brand, she shares some awesome insights based on her experience building a career in tech.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/discovery-questions-freelance-web-development?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;12 Discovery Questions to Ask Freelance Web Development Clients&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Especially at the outset of a freelance career in web development, one of the most challenging things to do is manage clients. Asking the right questions when starting a project can help the whole process run a lot smoother. Thanks to Coner for sharing these great questions!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/14-actionable-tips-for-developer-productivity?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;14 Actionable Tips for Developer Productivity&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you haven’t heard of &lt;a href="https://twitter.com/trostcodes"&gt;Alex Trost and Frontend Horse&lt;/a&gt;, you’re lucky to have stumbled on this post. He’s one of the most productive and hardworking developers I’ve met, and the tips he shared in this post are things you can immediately do to improve your productivity — in a healthy way. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/how-to-choose-the-best-css-framework?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;How to Choose the Best CSS Framework: Understanding Metrics and Context&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Have you ever wondered how different parts of development evolved to where they are today? Anthony Campolo gave us a tour of CSS framework history, and it provides an excellent context for understanding which option might work best for you and your project. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/how-we-helped-bring-new-nuxt-3-link-component?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;How We Helped Bring You the New Nuxt 3 Link Component&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/li_hbr"&gt;Lucie&lt;/a&gt; is our resident Nuxt Ambassador and all-around developer extraordinaire. She spent the first part of this year bringing her RFC for &lt;code&gt;&amp;lt;NuxtLink&amp;gt;&lt;/code&gt; to life and shared a bit about her experience in this post. We’re all really proud of the work she’s doing, and I can’t wait to see what she does next!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://prismic.io/blog/accessible-components-in-a-cms?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;Part 3: Striving for Accessibility When Building Components for a CMS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Accessibility is a topic that’s near and dear to me, and when Alexander Dubovoy proposed a series on it, I was thrilled. As developers, we have a unique perspective of the need and requirements for accessibility on the web. This is the third installment in a series on working with accessibility in Next.js, which takes developers through the unique concerns that arise when we hand websites off to a content team at the helm of a CMS.&lt;/p&gt;

&lt;p&gt;There are many more exciting things ahead of us, from a &lt;a href="https://prismic.io/blog/coding-challenges-newsletter?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto_monthly&amp;amp;utm_content=article_title"&gt;coding challenge newsletter&lt;/a&gt; to a bit of a makeover for our blog. I can't wait to share more next month!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>css</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Make a Website with Svelte and SvelteKit</title>
      <dc:creator>Sam Littlefair</dc:creator>
      <pubDate>Wed, 24 Mar 2021 14:24:44 +0000</pubDate>
      <link>https://dev.to/teamprismic/how-to-make-a-website-with-svelte-and-sveltekit-3i19</link>
      <guid>https://dev.to/teamprismic/how-to-make-a-website-with-svelte-and-sveltekit-3i19</guid>
      <description>&lt;p&gt;Svelte is one of the fastest-growing web development frameworks, and Sveltekit is Svelte's web app development framework. In this tutorial, you'll learn how to build and launch a website from scratch with Svelte and Sveltekit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But, head's up!&lt;/strong&gt; Svelte is in beta, so it still has lots of bugs, and many of these steps are likely to change.&lt;/p&gt;

&lt;p&gt;You can see the &lt;a href="https://github.com/samlfair/svelte-tutorial" rel="noopener noreferrer"&gt;final code for this project on GitHub&lt;/a&gt;, and &lt;a href="https://lucid-murdock-988f01.netlify.app/" rel="noopener noreferrer"&gt;the final project live on Netlify&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Svelte?
&lt;/h2&gt;

&lt;p&gt;Svelte is a JavaScript framework for creating web apps. Whereas other frameworks like React and Vue.js generally add code to your web app to make it work in the user's browser, Svelte compiles the code that you write when you build your app. In doing so, it creates very small files and fast websites.&lt;/p&gt;

&lt;p&gt;As a compiler, when you write Svelte, it looks unique. Here's an example of a Svelte file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;world&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello {name}!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That will generate a web page that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2Fe6ce8b09-3062-41b8-88dc-06ba630deaed_Screen%2BShot%2B2021-03-22%2Bat%2B2.37.02%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2Fe6ce8b09-3062-41b8-88dc-06ba630deaed_Screen%2BShot%2B2021-03-22%2Bat%2B2.37.02%2BPM.png%3Fauto%3Dcompress%2Cformat" alt="Hello world svelte example in the browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Svelte looks like HTML, with &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tags included, but it also adds syntax to make your HTML dynamic, inside curly braces. All of this code gets transformed into vanilla HTML, CSS, and JavaScript with Svelte's compiler.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Sveltekit?
&lt;/h2&gt;

&lt;p&gt;Currently the most popular application framework for Svelte is Sapper. Sveltekit is the new official framework developed by Svelte, superseding Sapper as Svelte's go-to framework. It adds key features like routing, layouts, and state management to Svelte.&lt;/p&gt;

&lt;p&gt;Sveltekit allows you to make static sites, server-rendered sites, and even hybrid static-and-server-rendered web apps. It also has extremely fast hot reloading in development mode because of the way it bundles JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This tutorial draws heavily from the &lt;a href="https://sk-incognito.vercel.app/learn/getting-started" rel="noopener noreferrer"&gt;SK Incognito docs&lt;/a&gt;. Big thanks to SK Incognito for documenting Sveltekit in development.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;This tutorial assumes you're already familiar with the basics of HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;p&gt;You'll need Node Node 12 LTS or Node 14 LTS and npm installed. Here's how to install Node and npm on &lt;a href="https://wsvincent.com/install-node-js-npm-mac/" rel="noopener noreferrer"&gt;Mac&lt;/a&gt; and &lt;a href="https://wsvincent.com/install-node-js-npm-windows/" rel="noopener noreferrer"&gt;Windows&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;In your terminal, run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init svelte@next svelte-kit-app
&lt;span class="c"&gt;# replace `svelte-kit-app` with whatever you like&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll get a warning in the terminal that Sveltekit is in development. Take heed.&lt;/p&gt;

&lt;p&gt;In the options, do not use TypeScript, Less, or SCSS. As Sveltekit is still in alpha, we'll stick with plain 'ol CSS and JavaScript (for now).&lt;/p&gt;

&lt;p&gt;Once the setup is complete, cd into your new folder and install dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the app in dev mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now view Svelte's classic counter app in your browser at &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make a new homepage
&lt;/h2&gt;

&lt;p&gt;In Sveltekit, every page is a Svelte component. Svelte components are identified by their .svelte extension. Pages are stored in &lt;code&gt;~/src/routes&lt;/code&gt;, and every component in this directory is a page in your app (we'll discuss that more in our section on routing, below).&lt;/p&gt;

&lt;p&gt;To get started, we'll overwrite the content of &lt;code&gt;~/src/routes/index.svelte&lt;/code&gt; (the app's homepage).&lt;/p&gt;

&lt;p&gt;Erase everything on that page, and replace it with a simple heading, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Homepage&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you click save, your browser should update instantly to display the new homepage:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F35cb339c-0378-4d17-b90e-a4dcbffaa6ee_Screen%2BShot%2B2021-03-22%2Bat%2B2.49.01%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F35cb339c-0378-4d17-b90e-a4dcbffaa6ee_Screen%2BShot%2B2021-03-22%2Bat%2B2.49.01%2BPM.png%3Fauto%3Dcompress%2Cformat" alt="Screenshot of a Sveltekit app with the heading "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For starters, we can edit this page as normal HTML. Try adding some content in-between the main tags to see what happens.&lt;/p&gt;

&lt;p&gt;Then, try adding a style tag, with some CSS inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Homepage&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;hr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is my new Sveltekit app.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add interactivity
&lt;/h2&gt;

&lt;p&gt;Svelte makes it easier to create interaction between JavaScript and HTML. Declare a variable in your JavaScript and then include it in your HTML in curly braces.&lt;/p&gt;

&lt;p&gt;Try updating your homepage like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ~/src/routes/index.svelte --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{number}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;hr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is my new Sveltekit app.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can make your app interactive by binding a variable to an input. Try replacing your &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; sections with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Homepage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{text}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;bind:value=&lt;/span&gt;&lt;span class="s"&gt;{text}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should create an input. When you change the value of the input, it should change the text in the heading.&lt;/p&gt;

&lt;p&gt;In our app, we'll use JavaScript to fetch content from an API and display that content in HTML. In the next step, we'll set up a content API with Prismic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up Prismic
&lt;/h2&gt;

&lt;p&gt;If you don't already have a Prismic account, &lt;a href="https://prismic.io/dashboard/signup?redirectUri=/dashboard" rel="noopener noreferrer"&gt;create one&lt;/a&gt; (it's free). Then, visit &lt;a href="http://prismic.io/dashboard" rel="noopener noreferrer"&gt;prismic.io/dashboard&lt;/a&gt;, and create a new repo.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: If you want to skip this step, you can use the Prismic repository that we're using in these examples. Just skip to the next section, "Fetch content in Svelte," and use this URL for your API endpoint: &lt;code&gt;https://svelte-tutorial.cdn.prismic.io/api/v2&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In your new repo, create a repeatable Custom Type called "page".&lt;/p&gt;

&lt;p&gt;Add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  a Key Text field called "title",&lt;/li&gt;
&lt;li&gt;  a UID field called "uid",&lt;/li&gt;
&lt;li&gt;  an Image field called "image",&lt;/li&gt;
&lt;li&gt;  and a Rich Text field called "content".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;✨ For a shortcut, you can copy-paste &lt;a href="https://gist.github.com/samlfair/327314b90b7f220c17fb0cb9250fd935" rel="noopener noreferrer"&gt;this JSON&lt;/a&gt; into the JSON Editor in the Custom Type builder, and it will configure all of these fields for you.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, go back to the main page of your repository and create your first document. Give it the title and UID "homepage". Then, add an image and some content, and click Save and Publish.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F4ef2cd14-7d7a-410a-88ef-e2d036c0e326_Screen%2BShot%2B2021-03-22%2Bat%2B3.11.45%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F4ef2cd14-7d7a-410a-88ef-e2d036c0e326_Screen%2BShot%2B2021-03-22%2Bat%2B3.11.45%2BPM.png%3Fauto%3Dcompress%2Cformat" alt="Screenshot of the Prismic editor."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a new tab, go to &lt;code&gt;&amp;lt;your-repo-name&amp;gt;.prismic.io/api/v2&lt;/code&gt;. This will open your API browser, allowing you to view your content on the Prismic API. Click Search documents, and the document you just published should appear:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F210fbb26-fc96-45c2-8f6c-b6a628493b97_Screen%2BShot%2B2021-03-22%2Bat%2B3.17.22%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F210fbb26-fc96-45c2-8f6c-b6a628493b97_Screen%2BShot%2B2021-03-22%2Bat%2B3.17.22%2BPM.png%3Fauto%3Dcompress%2Cformat" alt="Screenshot of the Prismic API browser."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we're going to use Prismic's dev tools to fetch content and render it in Svelte.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fetch content in Svelte
&lt;/h2&gt;

&lt;p&gt;We will use two packages to work with Prismic in Svelte. &lt;code&gt;@prismicio/client&lt;/code&gt; is Prismic's basic JavaScript package for fetching content from the API, and prismic-dom is Prismic's basic package for rendering content in the DOM.&lt;/p&gt;

&lt;p&gt;To install them, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-D&lt;/span&gt; @prismicio/client prismic-dom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a directory at the root of your project, called &lt;code&gt;utils/&lt;/code&gt;. Inside, create a file called &lt;code&gt;client.js&lt;/code&gt;, and paste in this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Prismic&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@prismicio/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiEndpoint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://your-repo-name.cdn.prismic.io/api/v2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Prismic&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;apiEndpoint&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to update your repo name in the &lt;code&gt;apiEndpoint&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;Now, in our homepage component, &lt;code&gt;~/src/routes/index.svelte&lt;/code&gt;, we'll add our new utilities. Update your component like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ~/src/routes/index.svelte --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;context=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./../../utils/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PrismicDom&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;prismic-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;homepage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Homepage&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;pre&amp;gt;&lt;/span&gt;{JSON.stringify(document, null, 2)}&lt;span class="nt"&gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What's happening here?&lt;/p&gt;

&lt;p&gt;The most important thing is the &lt;code&gt;load()&lt;/code&gt; function. This function accepts information about the current page as arguments and returns props that you can use in your app.&lt;/p&gt;

&lt;p&gt;Inside that function, we're using the Prismic query helper &lt;code&gt;Client.getByUID()&lt;/code&gt; to fetch your homepage document from the API and then returning that document as a prop.&lt;/p&gt;

&lt;p&gt;Then, in a separate script tag, we initialize the response variable, which makes the variable accessible in our app.&lt;/p&gt;

&lt;p&gt;If everything worked, you should now see your raw API response on the page.&lt;/p&gt;

&lt;p&gt;Of course, we don't want to display JSON. Instead, let's display some human-readable content, by updating the &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; tag, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{document.data.title}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the title of your document is coming directly from Prismic.&lt;/p&gt;

&lt;p&gt;Prismic provides utilities for working with Rich Text. &lt;code&gt;prismic-dom&lt;/code&gt; will convert your Rich Text field to HTML. Then, you can use Svelte's &lt;code&gt;{@html }&lt;/code&gt; utility to render it.&lt;/p&gt;

&lt;p&gt;Update your &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; tag like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{document.data.title}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should have some content on your page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2Fe3de784c-fccb-484e-9754-3fd752236c03_Screen%2BShot%2B2021-03-22%2Bat%2B3.47.14%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2Fe3de784c-fccb-484e-9754-3fd752236c03_Screen%2BShot%2B2021-03-22%2Bat%2B3.47.14%2BPM.png%3Fauto%3Dcompress%2Cformat"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Style your content
&lt;/h2&gt;

&lt;p&gt;Let's bind an inline style. We'll create a header section and use the image from Prismic as the background:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ~/src/routes/index.svelte --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;context=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./../../utils/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PrismicDom&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;prismic-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;homepage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header container"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"background-image: url('{document.data.image.url}')"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
      {document.data.title}
    &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      {@html PrismicDom.RichText.asHtml(document.data.content)}
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;25vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex-end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This looks good, but we've still got some unnecessary padding around the whole page. We can eliminate that with a CSS reset. In Svelte, CSS is scoped to the component. That means that the CSS in the component only styles that component. To style the document's &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag (where the padding is), we need to import a style sheet.&lt;/p&gt;

&lt;p&gt;For starters, create the folder &lt;code&gt;~/src/styles/&lt;/code&gt;, and then add a file called &lt;code&gt;reset.css&lt;/code&gt;. Inside that file, paste the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* ~/static/styles/reset.css */&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we need to import those styles to the component. You can do this by importing a CSS file in the component's second &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../styles/reset.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the page reloads, the hero image should be full-width.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a layout
&lt;/h2&gt;

&lt;p&gt;However, we know that we want the CSS reset on every page of the website. We can abstract it out of our component by moving it to a layout.&lt;/p&gt;

&lt;p&gt;If you have content that appears on every page --- like a header and footer --- you can move it into a layout file. To create a layout, create the file &lt;code&gt;~/src/routes/$layout.svelte&lt;/code&gt;. In that file, paste this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ~/src/routes/$layout.svelte --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../styles/reset.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex-layout"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;© Acme Corp, 1951&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nc"&gt;.footer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.flex-layout&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;space-between&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;slot&amp;gt;&lt;/code&gt; element is where your page component will be inserted.&lt;/p&gt;

&lt;p&gt;You can now remove the CSS reset from &lt;code&gt;~/src/routes/index.svelte&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We can abstract more styles to the layout by creating a file called globals.css in &lt;code&gt;~/src/styles/&lt;/code&gt; and importing that CSS to your layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../styles/reset.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../styles/globals.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For instance, you can delete the &lt;code&gt;main&lt;/code&gt; and &lt;code&gt;.container&lt;/code&gt; style rules from &lt;code&gt;index.svelte&lt;/code&gt; and these rules to &lt;code&gt;~/src/styles/globals.css&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You've now created a page of your website with JavaScript and CSS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2Fb5bd8220-f674-4f68-9645-117ec1dff7b3_Screen%2BShot%2B2021-03-22%2Bat%2B5.00.14%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2Fb5bd8220-f674-4f68-9645-117ec1dff7b3_Screen%2BShot%2B2021-03-22%2Bat%2B5.00.14%2BPM.png%3Fauto%3Dcompress%2Cformat" alt="A screenshot of a homepage with a wide banner image."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we'll look at how to add more pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add multiple pages
&lt;/h2&gt;

&lt;p&gt;In Svelte, every file in &lt;code&gt;~/src/routes/&lt;/code&gt; represents a route in your app, so &lt;code&gt;~/src/routes/dogs/daschund.svelte&lt;/code&gt; corresponds to &lt;code&gt;your-site.com/dogs/daschund&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;File and folder names in square brackets are dynamic routes. So, the file &lt;code&gt;~/src/routes/dogs/[breed].svelte&lt;/code&gt; would generate the route &lt;code&gt;/dogs/*&lt;/code&gt;. If you visit &lt;code&gt;/dogs/doberman&lt;/code&gt;, you will get the &lt;code&gt;[breed].svelte&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Similarly, folder names can be dynamic. So, you could have &lt;code&gt;~/src/routes/[pet]/[breed].svelte&lt;/code&gt;, which would be rendered for both &lt;code&gt;/fish/goldfish&lt;/code&gt; and &lt;code&gt;/cat/siamese&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To proceed, copy the contents of &lt;code&gt;~/src/routes/index.svelte&lt;/code&gt; into a new file in the same folder called &lt;code&gt;[uid].svelte&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;[uid].svelte&lt;/code&gt;, modify the &lt;code&gt;load()&lt;/code&gt; function to destructure the page prop (the props include information about the current page) like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;uid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;homepage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;uid&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;page.params&lt;/code&gt; is an object containing the variables from the URL path, which are specified in the file and folders with square brackets around their names. In the example above, &lt;code&gt;/fish/goldfish&lt;/code&gt; would have a &lt;code&gt;page.params&lt;/code&gt; object like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;pet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fish&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;goldfish&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, in the &lt;code&gt;load()&lt;/code&gt; function, we extract the &lt;code&gt;uid&lt;/code&gt; parameter from the page route and add it to the &lt;code&gt;props&lt;/code&gt; object, which the function returns.&lt;/p&gt;

&lt;p&gt;Then, add &lt;code&gt;uid&lt;/code&gt; to the export statement in the second &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we can use the &lt;code&gt;uid&lt;/code&gt; variable somewhere in the template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header container"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"background-image: url('{document.data.image.url}')"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
      {uid}
    &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      {@html PrismicDom.RichText.asHtml(document.data.content)}
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, navigate to another page at the root-level of your website, like &lt;code&gt;/doberman&lt;/code&gt; or &lt;code&gt;/tabby&lt;/code&gt;. If everything is working, you should see the &lt;code&gt;uid&lt;/code&gt; param in your page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F0471b55c-ca22-4e52-9a6b-3c4fa4097f8c_Screen%2BShot%2B2021-03-22%2Bat%2B5.01.59%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F0471b55c-ca22-4e52-9a6b-3c4fa4097f8c_Screen%2BShot%2B2021-03-22%2Bat%2B5.01.59%2BPM.png%3Fauto%3Dcompress%2Cformat" alt="A screenshot of a webpage with "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, it's not very useful to directly display the param on the page. Instead, we want to use it to dynamically display content.&lt;/p&gt;

&lt;p&gt;In the Prismic query function, replace "homepage" with the &lt;code&gt;uid&lt;/code&gt; variable. Now, Svelte will query content from Prismic depending on the page path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;uid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;uid&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Right now, there is only one document in Prismic. Go back to your Prismic repo, and create a page with the UID "about", and add some content to the page. Now, if you go to &lt;code&gt;/about&lt;/code&gt;, you should see your new about page.&lt;/p&gt;

&lt;p&gt;In your &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; tag, remove the &lt;code&gt;uid&lt;/code&gt; variable and replace the document title:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header container"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"background-image: url('{document.data.image.url}')"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
      {document.data.title}
    &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      {@html PrismicDom.RichText.asHtml(document.data.content)}
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a nav component
&lt;/h2&gt;

&lt;p&gt;Finally, we can add some site navigation. Let's create a nav component in &lt;code&gt;~/src/lib/&lt;/code&gt;, called &lt;code&gt;nav.svelte&lt;/code&gt;. Paste in the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ~/src/lib/nav.svelte --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"menu"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/about"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;  
  &lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;25px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;25px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;.8&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;6px&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;.8&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in your layout file, import the &lt;code&gt;Nav&lt;/code&gt; component and update your HTML and CSS like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ~/src/routes/$layout.svelte --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../lib/nav.svelte&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../styles/reset.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./../styles/globals.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex-layout"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"absolute"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Nav&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;© Acme Corp, 1951&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nc"&gt;.absolute&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.footer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.flex-layout&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;space-between&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you should have two pages that you can click before and forth between:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F3c4846e9-0384-423d-8ce9-b85d1a003178_Screen%2BShot%2B2021-03-22%2Bat%2B5.19.54%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F3c4846e9-0384-423d-8ce9-b85d1a003178_Screen%2BShot%2B2021-03-22%2Bat%2B5.19.54%2BPM.png%3Fauto%3Dcompress%2Cformat"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy your site
&lt;/h2&gt;

&lt;p&gt;For now, deploying with Sveltekit is a little tricky, as it is still in development. Sveltekit has a handful of "adapters" to handle deployment in different environments. For now, we'll deploy statically on Netlify.&lt;/p&gt;

&lt;p&gt;To install the necessary adapter, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-D&lt;/span&gt; @sveltejs/adapter-static
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in &lt;code&gt;~/svelte.config.cjs&lt;/code&gt;, set the adapter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sveltejs/adapter-static&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./package.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/** @type {import('@sveltejs/kit').Config} */&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;kit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// By default, `npm run build` will create a standard Node app.&lt;/span&gt;
    &lt;span class="c1"&gt;// You can create optimized builds for different platforms by&lt;/span&gt;
    &lt;span class="c1"&gt;// specifying a different adapter&lt;/span&gt;
    &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;static&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;

    &lt;span class="c1"&gt;// hydrate the &amp;lt;div id="svelte"&amp;gt; element in src/app.html&lt;/span&gt;
    &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="na"&gt;vite&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;ssr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;noExternal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pkg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dependencies&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{}),&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, make sure your project is pushed to Github. You'll need to initialize your project as a git repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add all of your files to staging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And commit them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Init"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In GitHub, create a new repository and follow the instructions to push your project to GitHub.&lt;/p&gt;

&lt;p&gt;Visit Netlify and create an account or log in. Click New site from Git. Follow the instructions to deploy your new GitHub repo.&lt;/p&gt;

&lt;p&gt;For the deploy settings, ensure the build command is npm run build, and the build directory is build.&lt;/p&gt;

&lt;p&gt;Once you deploy your site, it should be live!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F637de1a9-336a-4a80-bbac-4771f4cd82f9_Screen%2BShot%2B2021-03-23%2Bat%2B7.58.40%2BPM.png%3Fauto%3Dcompress%2Cformat" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.prismic.io%2Fwroom%2F637de1a9-336a-4a80-bbac-4771f4cd82f9_Screen%2BShot%2B2021-03-23%2Bat%2B7.58.40%2BPM.png%3Fauto%3Dcompress%2Cformat"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  See a bug?
&lt;/h2&gt;

&lt;p&gt;If you notice a bug in this tutorial, please add a comment or get at me on Twitter: &lt;a href="https://twitter.com/samlfair" rel="noopener noreferrer"&gt;@samlfair&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading :)&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;To keep learning, check out these resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/samlfair/svelte-tutorial" rel="noopener noreferrer"&gt;The code for this project on GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://prismic.io/docs/technologies/javascript" rel="noopener noreferrer"&gt;Prismic's JavaScript documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://svelte.dev/" rel="noopener noreferrer"&gt;Official Svelte docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://kit.svelte.dev/docs" rel="noopener noreferrer"&gt;Official Sveltekit docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://sveltesociety.dev/cheatsheet/" rel="noopener noreferrer"&gt;Svelte Society Svelte Cheatsheet&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://sk-incognito.vercel.app/learn/getting-started" rel="noopener noreferrer"&gt;SK Incognito Docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/sveltejs/kit" rel="noopener noreferrer"&gt;Sveltekit on GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This tutorial was originally published &lt;a href="https://prismic.io/blog/svelte-sveltekit-tutorial" rel="noopener noreferrer"&gt;on the Prismic blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>prismic</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
