<?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: Stackbit</title>
    <description>The latest articles on DEV Community by Stackbit (@stackbit).</description>
    <link>https://dev.to/stackbit</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%2F826%2F846d3882-e4e6-4577-b6f9-a15abbc4f52a.png</url>
      <title>DEV Community: Stackbit</title>
      <link>https://dev.to/stackbit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stackbit"/>
    <language>en</language>
    <item>
      <title>The Challenges Marketers and Developers Face in the Era of Headless CMS</title>
      <dc:creator>TiffinTech</dc:creator>
      <pubDate>Thu, 27 Apr 2023 16:54:09 +0000</pubDate>
      <link>https://dev.to/stackbit/the-challenges-marketers-and-developers-face-in-the-era-of-headless-cms-l30</link>
      <guid>https://dev.to/stackbit/the-challenges-marketers-and-developers-face-in-the-era-of-headless-cms-l30</guid>
      <description>&lt;p&gt;While headless CMS has proven its efficiency, flexibility, and speed, it also comes with its own set of challenges for both marketers and developers. In this article, I will outline three key points that outline these challenges and provide insights on how to overcome them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Bridging the Gap Between Content and Presentation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the core benefits of a headless CMS is its separation of content from presentation. This allows developers and marketers to work on the same platform without any constraints on the creative process. However, this separation also creates friction, as marketers are often less technically inclined and may struggle to visualize the final outcome of their content.&lt;/p&gt;

&lt;p&gt;To overcome this challenge, it is essential to have a strong collaboration between the marketing and development teams. Providing a user-friendly interface for marketers to preview their content in real-time can bridge this gap, making it easier for them to understand how their work will appear in the final product. This can be achieved by using a tool such as &lt;a href="https://www.stackbit.com/"&gt;Stackbit&lt;/a&gt; that provides marketers with a visual editor and enables developers to work with their preferred tech stack. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Managing Workflows in a Decoupled Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a traditional CMS, developers and marketers often rely on the same system to manage their workflows. However, with a headless CMS, these workflows become decoupled, which may lead to a lack of visibility and coordination between teams.&lt;/p&gt;

&lt;p&gt;To address this issue, it is important to establish clear communication channels and create a well-defined workflow. Utilizing project management tools and platforms like Trello, Asana, or Slack can help teams stay on the same page and track progress more effectively. By defining roles, responsibilities, and deadlines, marketers and developers can work more cohesively, leading to a smoother content production process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Balancing Flexibility and Security&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Headless CMS offers unparalleled flexibility in terms of content delivery, enabling developers to use various front-end frameworks and technologies. While this flexibility is a significant advantage, it can also lead to potential security vulnerabilities as content is served through APIs.&lt;/p&gt;

&lt;p&gt;To ensure the security of their content, developers must be vigilant about their choice of APIs and frameworks. By implementing best practices such as securing API keys, using authentication and authorization protocols, and monitoring access logs, developers can minimize potential risks. Additionally, staying informed about the latest security trends and updates in the industry will ensure that the content management system remains protected from new threats.&lt;/p&gt;

&lt;p&gt;Conclusion &lt;/p&gt;

&lt;p&gt;While headless CMS presents new challenges for marketers and developers, these can be effectively addressed with clear communication, well-defined workflows, and a focus on security. By embracing these strategies, teams can successfully navigate the friction that arises from working in a headless CMS environment and unlock the full potential of this innovative content management approach.&lt;/p&gt;

&lt;p&gt;Here is a full video discussion to learn more about the challenges marketers and developers face while working with a headless CMS. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-Yg0g1mFQ2U"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>headless</category>
      <category>cms</category>
      <category>headlesscms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How To Enhance Your Web Development Process with Stackbit and Storybook</title>
      <dc:creator>TiffinTech</dc:creator>
      <pubDate>Thu, 06 Apr 2023 18:58:05 +0000</pubDate>
      <link>https://dev.to/stackbit/how-to-enhance-your-web-development-process-with-stackbit-and-storybook-1pne</link>
      <guid>https://dev.to/stackbit/how-to-enhance-your-web-development-process-with-stackbit-and-storybook-1pne</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Ensure that you have installed Stackbit. Stackbit is a visual editor that enables content editors to build pages and update content directly on the site, without having to rely on developers. Allowing developers to focus on building features and working on larger tasks. Follow this &lt;a href="https://docs.stackbit.com/#getting-started" rel="noopener noreferrer"&gt;step-by-step guide &lt;/a&gt;for how to simply add in Stackbit locally to a project. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install the &lt;a href="https://www.npmjs.com/package/@stackbit/storybook-addon" rel="noopener noreferrer"&gt;stackbit/storybook-addon&lt;/a&gt;for Storybook. This plugin will allow you to create Stackbit models and presets based on your existing components and stories. These generated models can serve as a starting point for setting up model definitions and presets in a new project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the add-on is installed, return to your Storybook project. You should now see a Stackbit tab that will allow you to generate new models based on your components and stories.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For6h1i1uj7he0olz24h7.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For6h1i1uj7he0olz24h7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.Click on the Stackbit tab and follow the prompts to download your newly generated models. These models can then be used to set up Stackbit content editing within your Storybook project.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs1vp5kxijw9rtthvfh1y.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs1vp5kxijw9rtthvfh1y.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By following these simple steps, you can easily set up Stackbit with Storybook, providing your content editors with the ability to update site content without developer intervention, while simultaneously enabling your developers to build more efficiently.&lt;/p&gt;

&lt;p&gt;Here is a video diving deep into each step using a Next.js project. Enjoy! &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/z4I4V8lmXPc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>3 Creative VS Code Extensions You Need To Try Out</title>
      <dc:creator>TiffinTech</dc:creator>
      <pubDate>Tue, 28 Mar 2023 19:26:48 +0000</pubDate>
      <link>https://dev.to/stackbit/3-creative-vs-code-extensions-you-need-to-try-out-284b</link>
      <guid>https://dev.to/stackbit/3-creative-vs-code-extensions-you-need-to-try-out-284b</guid>
      <description>&lt;h2&gt;
  
  
  Polacode
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0gih77v9cgtkd4cuxxa9.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0gih77v9cgtkd4cuxxa9.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=pnp.polacode" rel="noopener noreferrer"&gt;Polacode&lt;/a&gt; is an incredible Visual Studio Code extension that makes it easy for developers to create stunning screenshots of their code. With Polacode, users can quickly and accurately select the code they want to capture and generate a high-quality image. And it doesn't stop there; they can also take advantage of the several customization options available such as changing the font size and background color, or adding a caption to their image. &lt;/p&gt;

&lt;p&gt;One of the most notable aspects of Polacode is its ability to capture code with syntax highlighting retained, making it ideal for tutorials, presentations, or any other scenario where code readability is important. Furthermore, Polacode is open source and actively maintained by its development team, so users can rest assured knowing new updates and bug fixes are regularly released. &lt;/p&gt;

&lt;p&gt;In short, Polacode is an excellent resource for developers who need to create visually appealing code screenshots for documentation, tutorials or social media platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Better Comments
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26jkoj8io5vswcq3n9ph.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26jkoj8io5vswcq3n9ph.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments" rel="noopener noreferrer"&gt;The Better Comments&lt;/a&gt; extension for VS Code is an incredibly useful tool that can make it much easier to understand and organize code comments. It does this by introducing a set of special annotations that can be used to provide more context and structure to code comments, making them more readable and providing greater clarity as to their purpose.&lt;/p&gt;

&lt;p&gt;For example, the software allows users to assign different colors to comments based on the keyword they begin with. This allows developers to quickly differentiate between comments intended for tasks that need to be completed in the future (such as those beginning with "TODO"), and those containing important information or advice (beginning with "NOTE"). In addition, visual separators such as asterisks or equal signs can be added between different categories of comments, helping to further organize each section of code.&lt;/p&gt;

&lt;p&gt;Beyond this, Better Comments includes a number of other annotation keywords which can be used to add additional meaning and context to code comments. For instance, the “HIGHLIGHT” keyword can be used to draw attention to an important piece of code, while “QUESTION” may be used when asking a direct question within the comment. Ultimately this allows developers to communicate more effectively with their peers by creating more detailed, informative commentary on their work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Peacock
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1s4fpb9qm3sxpqeia44.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1s4fpb9qm3sxpqeia44.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The VS Code extension &lt;a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock" rel="noopener noreferrer"&gt;Peacock&lt;/a&gt; is a great tool for streamlining workflow and visually organizing the workspace. With this powerful extension, developers can easily distinguish between different projects, instances of VS Code, or other related work. &lt;/p&gt;

&lt;p&gt;Peacock has the ability to generate unique colors for each project or allow users to set their own custom colors. This feature simplifies the process of telling apart multiple projects running at once and saves time from having to manually switch between them. Additionally, Peacock integrates with popular VS Code themes so that users can quickly create a unified color scheme across the entire IDE.&lt;/p&gt;

&lt;p&gt;Moreover, Peacock offers a high degree of customization, allowing developers to adjust individual components like the status bar, title bar and activity bar according to their needs. This makes it possible to develop a personalized workspace tailored specifically to one's workflow and preferences. All in all, this convenient extension provides an easy way for developers to gain more control over their environment and improve productivity.&lt;/p&gt;

&lt;p&gt;Want to see some more cool VS Code extensions? Check out the video we created diving into these and more. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/KHXaj4yk-XI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>programming</category>
    </item>
    <item>
      <title>How Dan &amp; Bob (and a Company You've Never Heard of) Changed Computers Forever</title>
      <dc:creator>Ryland @ Stackbit</dc:creator>
      <pubDate>Tue, 09 Nov 2021 21:53:04 +0000</pubDate>
      <link>https://dev.to/stackbit/how-dan-bob-and-a-company-youve-never-heard-of-changed-computers-forever-45gh</link>
      <guid>https://dev.to/stackbit/how-dan-bob-and-a-company-youve-never-heard-of-changed-computers-forever-45gh</guid>
      <description>&lt;p&gt;You’ve never heard of Dan or Bob.&lt;/p&gt;

&lt;p&gt;But you should have. &lt;/p&gt;

&lt;p&gt;They built a company, VisiCalc, that led to Apple's first big success and changed computers forever.&lt;/p&gt;

&lt;p&gt;Here’s their story.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--scHqn05X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/url92zbbnvmrw4x1cr48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--scHqn05X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/url92zbbnvmrw4x1cr48.png" alt="Dan and Bob of VisiCalc" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The year is 1976&lt;/p&gt;

&lt;p&gt;And Dan Bricklin is walking into class at Harvard Business School&lt;/p&gt;

&lt;p&gt;He sees a dozen chalkboards connected by one massive matrix of rows and columns. With a calculator, you could change one cell and ripple thru all the connected cells. &lt;/p&gt;

&lt;p&gt;This made Dan think:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Rsb6MHAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6eodf2skoqlxeyh8hh5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rsb6MHAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6eodf2skoqlxeyh8hh5x.png" alt="Dan's first thoughts for VisiCalc" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few years later, Dan built the first version of VisiCalc&lt;/p&gt;

&lt;p&gt;It took 1 week.&lt;/p&gt;

&lt;p&gt;It didn’t scroll. The decimals weren’t fixed. But it solved one huge problem—it lettered the columns and numbered the rows, so you could refer to each cell&lt;/p&gt;

&lt;p&gt;Heres a photo of it from Dan’s old 35mm camera&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JKO-XbBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/345i0u6tfav4oygj9f2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JKO-XbBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/345i0u6tfav4oygj9f2y.png" alt="VisiCalc's alpha" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dan was ecstatic. But he hit his programming limits. So he recruited his buddy Bob Frankston from MIT&lt;/p&gt;

&lt;p&gt;Bob went to work in the attic of this house. He used a shared MIT system that was expensive to use during prime daytime hours.&lt;/p&gt;

&lt;p&gt;So Bob slept during the day. And worked at night.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Obaaeuoz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i20mxl9fx1jj8xwdm4pc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Obaaeuoz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i20mxl9fx1jj8xwdm4pc.png" alt="The attic VisiCalc was built in" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bob hit one huge problem.&lt;/p&gt;

&lt;p&gt;He couldn't condense his 20KB VisiCalc code in the 16KB of the low-end Apple II.&lt;/p&gt;

&lt;p&gt;So when it shipped it was only available on the much more expensive 32KB Apple II. They were nervous it wouldn't sell.&lt;/p&gt;

&lt;p&gt;(Here’s some of Bob's first source code.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NlexYRbl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/614pmlvbdy59m4y9c0t3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NlexYRbl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/614pmlvbdy59m4y9c0t3.png" alt="VisiCalc's first source code" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before launch, Dan sneakily used it for a class assignment.&lt;/p&gt;

&lt;p&gt;The teacher told his class to analyze a Pepsi marketing campaign.&lt;/p&gt;

&lt;p&gt;The next day Dan came back with 5-year projections, testing all sorts of possibilities.&lt;/p&gt;

&lt;p&gt;When asked how he did it, he said "multiplication and addition"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gRvdxcPa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05zmyqltfwq2hy3k2zhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gRvdxcPa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05zmyqltfwq2hy3k2zhu.png" alt="Dan's using VisiCalc for his school work" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dan and Bob debuted VisiCalc – the very first computer spreadsheet – at a computer expo in Manhattan.&lt;/p&gt;

&lt;p&gt;It wasn’t well received.&lt;/p&gt;

&lt;p&gt;Only 22 people showed up. Of which 20 were friends and family. &lt;/p&gt;

&lt;p&gt;The 2 “real” attendees walked out early to see the TI 59 Calculator presentation. lol&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MkvJAC_D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rdjg3nizzb3qxgljqs9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MkvJAC_D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rdjg3nizzb3qxgljqs9.png" alt="Dan before launching VisiCalc" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In late 1979, Dan and Bob sold their first unit for $100.&lt;/p&gt;

&lt;p&gt;And it became a huge hit.&lt;/p&gt;

&lt;p&gt;News stories spoke about business folks lining up to buy VisiCalc and then, the next day, lining up again to buy the $2,500 Apple II when they realized it was the only computer it could run on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0ukja_Bp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmb7qsflhoopd4cpnu4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0ukja_Bp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmb7qsflhoopd4cpnu4p.png" alt="The packaging and first images of VisiCalc" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4 yrs later, Dan &amp;amp; Bob had sold &amp;gt;1M copies.&lt;/p&gt;

&lt;p&gt;It sold so well with the Apple II that Steve Jobs claimed VisiCalc the biggest single event that led to Apple’s success.&lt;/p&gt;

&lt;p&gt;"If VisiCalc had been written for some other computer, you'd be interviewing somebody else right now" -Steve Jobs&lt;/p&gt;

&lt;p&gt;Beyond all the success, Dan and Bob’s work convinced people that computers are not just toys.&lt;/p&gt;

&lt;p&gt;They are tools.&lt;/p&gt;

&lt;p&gt;And for that, we should know who they are and give them our thanks.&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;If you liked this story, I share more like it 1-2 times every week on &lt;a href="https://twitter.com/stackbit"&gt;Twitter here&lt;/a&gt;. Cheers!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>5 CSS shortcuts</title>
      <dc:creator>Ryland @ Stackbit</dc:creator>
      <pubDate>Tue, 09 Nov 2021 14:47:55 +0000</pubDate>
      <link>https://dev.to/stackbit/5-css-shortcuts-1lj0</link>
      <guid>https://dev.to/stackbit/5-css-shortcuts-1lj0</guid>
      <description>&lt;p&gt;It's amazing how long I didn't know about these. They make my style sheets much more clean. &lt;/p&gt;

&lt;p&gt;I hope they do the same for yours. :-)&lt;/p&gt;

&lt;h2&gt;
  
  
  1/ List properties, made simpler:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3teomvz9himdjgazyl3o.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3teomvz9himdjgazyl3o.png" alt="css-list-properties-short-cut"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2/ The background property, made easier:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdepn1pjac476j47o34d4.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdepn1pjac476j47o34d4.png" alt="css-background-property-short-cut"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  3/ Font and line-height properties, made like a pro:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7r5vb3ysezrqwiih3qd.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7r5vb3ysezrqwiih3qd.png" alt="css-font-line-height-properties-short-cut"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  4/ Margin and padding properties, made how they should be:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9zloe4z7g315ygnoqjn.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9zloe4z7g315ygnoqjn.png" alt="css-margin-padding-properties-short-cut"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  5/ Border property, made with love:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq5flfy8rcwe5d8u4q17u.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq5flfy8rcwe5d8u4q17u.png" alt="css-border-property-short-cut"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>An alternative way of looking at your career as a developer</title>
      <dc:creator>Ryland @ Stackbit</dc:creator>
      <pubDate>Wed, 03 Nov 2021 18:26:48 +0000</pubDate>
      <link>https://dev.to/stackbit/an-alternative-way-of-looking-at-your-career-as-a-developer-4e8h</link>
      <guid>https://dev.to/stackbit/an-alternative-way-of-looking-at-your-career-as-a-developer-4e8h</guid>
      <description>&lt;p&gt;The computer scientist, Bret Victor, empowers people to think the unthinkable. &lt;/p&gt;

&lt;p&gt;He’s become famous for it. And he’s done it with an approach to his career (and life) that’s not normal.&lt;/p&gt;

&lt;p&gt;I’ll explain Bret’s approach.&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;h2&gt;
  
  
  Bret is fascinated by ideas.
&lt;/h2&gt;

&lt;p&gt;He believes great ideas in the form of art, story &amp;amp; invention give meaning to people’s lives. &lt;/p&gt;

&lt;p&gt;Hence, bringing ideas into the world is one of the most important things people do.&lt;/p&gt;

&lt;h2&gt;
  
  
  So he asks: What tools create a healthy environment for ideas to grow?
&lt;/h2&gt;

&lt;p&gt;Let’s take coding. Here’s how a normal code environment works:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnlw78uqe8jt7o1zv04qu.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnlw78uqe8jt7o1zv04qu.gif" alt="normal-coding-environment-example"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Your time is spent working in the code blindly.&lt;/p&gt;

&lt;p&gt;To better nurture ideas, Bret invented a different coding environment.&lt;/p&gt;

&lt;p&gt;Here Bret's coding environment, next to this picture:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbuk7qy8xs68ezurt8he5.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbuk7qy8xs68ezurt8he5.gif" alt="bret-victors-code-environment-1"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Say you add code for the sky and sun.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmctryvn5rdfkvge0uyuf.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmctryvn5rdfkvge0uyuf.gif" alt="bret-victors-coding-environment-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's become Bret’s principle: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Creators need an immediate connection to what they create.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Meaning if you make a change, you see the effect immediately. &lt;/p&gt;

&lt;p&gt;When he notices that principle is violated, he takes it as his responsibility to fix it.&lt;/p&gt;

&lt;p&gt;Here's another example.&lt;/p&gt;

&lt;p&gt;In this game, we want the little guy to bounce through the&lt;br&gt;
little passageway.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawtc4pl0igdbwgkx57ok.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawtc4pl0igdbwgkx57ok.gif" alt="bret-victors-time-space-example-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;He built in immediate controls of space and time.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9ly30ua0926i89uw1a4.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9ly30ua0926i89uw1a4.gif" alt="bret-victors-time-space-example-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So Bret has this principle — that creators need an immediate connection.&lt;/p&gt;

&lt;p&gt;When he notices it being violated. He builds tools to right that wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  But why is this important?
&lt;/h2&gt;

&lt;p&gt;As a technologist, you can recognize a wrong in the world. And you can have a vision of what a better world could be. &lt;/p&gt;

&lt;p&gt;You can dedicate yourself to fighting for that principle. Social activists typically fight by organizing. But you, you can fight by inventing.&lt;/p&gt;

&lt;p&gt;The takeaway is that this lifestyle is an option that’s available to you. And it’s one you’re not going to hear much about. &lt;/p&gt;

&lt;p&gt;You can choose to sleepwalk through life and accept the tech world defining you by a skill. But you don't have to.&lt;/p&gt;

&lt;p&gt;If there’s something in the world you feel is a wrong. Then you can have a vision for what a better world could be. And you can find your principle&lt;/p&gt;

&lt;p&gt;So after this, think about what matters to you. What you believe in. What you might fight for&lt;/p&gt;

&lt;p&gt;Decide to define your life your way.&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;If you’d posts like this on your twitter feed, follow &lt;a href="https://twitter.com/stackbit" rel="noopener noreferrer"&gt;@stackbit on twitter&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>7 design principles for developers</title>
      <dc:creator>Ryland @ Stackbit</dc:creator>
      <pubDate>Wed, 13 Oct 2021 15:01:21 +0000</pubDate>
      <link>https://dev.to/stackbit/7-design-principles-for-developers-4efa</link>
      <guid>https://dev.to/stackbit/7-design-principles-for-developers-4efa</guid>
      <description>&lt;p&gt;Ever said this? And then have that happen?&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focy60cn1i67ywxj4z6g2.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focy60cn1i67ywxj4z6g2.png" alt="Meme of shit developers says"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yeah, me too. lol&lt;/p&gt;

&lt;p&gt;Here are 7 tips to help.&lt;/p&gt;

&lt;h2&gt;
  
  
  1/ Use Relative Units &amp;amp; Percentage Widths
&lt;/h2&gt;

&lt;p&gt;Using em, rem, and percentages helps your CSS styles flow across screen sizes.&lt;/p&gt;

&lt;p&gt;ex: If you need to change a breakpoint, your widths work across the board. And your font-sizes can change by simply changing the  element's font-size.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyvsdaii02jllzg4duvd.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyvsdaii02jllzg4duvd.png" alt="Relative units and percentage widths for css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2/ Content (not device width) determines breakpoints
&lt;/h2&gt;

&lt;p&gt;You don't want to end up in this loop: New device, new media queries, new device, new media query...&lt;/p&gt;

&lt;p&gt;To keep that from happening, here's what you do:&lt;/p&gt;

&lt;p&gt;Base your breakpoints on the natural qualities of your content. As screen size increases, pick where it’d be better in a new formation&lt;/p&gt;

&lt;p&gt;Boom! Breakpoint.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9kxdk8doymf3l7iaxmje.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9kxdk8doymf3l7iaxmje.png" alt="Best way to determine breakpoints in css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3/ Use min-width media queries
&lt;/h2&gt;

&lt;p&gt;Using min-width ensures that mobile styles get loaded without desktop styles mixed in. &lt;/p&gt;

&lt;p&gt;This can significantly improve the mobile experience and your site's SEO.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxeh8du6z7l9op7m4t21b.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxeh8du6z7l9op7m4t21b.png" alt="Why you should use min-width queries in css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4/ Start by listing features, not designing layout.
&lt;/h2&gt;

&lt;p&gt;If you’re building a cheap flights site don’t ask: “Should this item be on the left or right?”&lt;/p&gt;

&lt;p&gt;Instead ask: “What will our users need?”&lt;/p&gt;

&lt;p&gt;Write out items like a datepicker, input field, search button, etc. Then piece them together.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fftsxgx0ux9gfbqcfzqqe.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fftsxgx0ux9gfbqcfzqqe.png" alt="How to start designing a website page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5/ Follow the thumb rule
&lt;/h2&gt;

&lt;p&gt;75% of people use their thumb to operate their mobile device. Place key actions where it's easily accessible.&lt;/p&gt;

&lt;p&gt;💚: Easy access = Most important elements&lt;br&gt;
💛: A small reach = Secondary elements&lt;br&gt;
🧡: Takes effort = User always notices&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xyiog54mu72oxkykqdz.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xyiog54mu72oxkykqdz.png" alt="How to design a website page for mobile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6/ Sketch, Design, Code.
&lt;/h2&gt;

&lt;p&gt;Sketch first, always. Notice how the sketch is rough and details are left out. It gives room for interpretation on a design tool.&lt;/p&gt;

&lt;p&gt;But it’s also specific. It’s very clear how it works, what needs to be built, and what doesn’t need to be built.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fediasgpepwofurcv7j3g.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fediasgpepwofurcv7j3g.png" alt="Process for building a website page by Basecamp's Shape Up book"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7/ LT Browser
&lt;/h2&gt;

&lt;p&gt;The LT Browser was made specifically for testing website responsiveness.&lt;/p&gt;

&lt;p&gt;✅ +45 screen sizes to test on&lt;br&gt;
✅ Built-in dev tools for debugging&lt;br&gt;
✅ Network throttling testing&lt;br&gt;
✅ Local testing&lt;br&gt;
✅ Google Lighthouse performance reports&lt;/p&gt;

&lt;p&gt;How am I hearing about this now!?&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi78jpo8bnyx780wifz2x.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi78jpo8bnyx780wifz2x.png" alt="LT Browser overview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Big thank you to the folks quoted here.
&lt;/h2&gt;

&lt;p&gt;Luke Wroblewski: Mobile First Book&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/adamwathan"&gt;@adamwathan&lt;/a&gt; Steve Schoger: RefactoringUI&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/chriscoyier"&gt;@chriscoyier&lt;/a&gt;: CSS Tricks&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/dhh"&gt;@dhh&lt;/a&gt;, @jasonfried: Shape Up Book&lt;/p&gt;

&lt;p&gt;And that's it!&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;If you found this helpful, let me know by liking the &lt;a href="https://twitter.com/stackbit/status/1448291138218065927?s=20" rel="noopener noreferrer"&gt;tweet thread on Twitter&lt;/a&gt;. 💖🙏&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtu7ym5iqfm6kdpx8d2t.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtu7ym5iqfm6kdpx8d2t.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>7 Ways to Escape CSS Hell</title>
      <dc:creator>Ryland @ Stackbit</dc:creator>
      <pubDate>Tue, 12 Oct 2021 00:23:51 +0000</pubDate>
      <link>https://dev.to/stackbit/7-ways-to-escape-css-hell-2ck6</link>
      <guid>https://dev.to/stackbit/7-ways-to-escape-css-hell-2ck6</guid>
      <description>&lt;p&gt;Ever have this happen? lol&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0r2aymznlg20174dp1kn.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0r2aymznlg20174dp1kn.png" alt="Funny meme about centering with css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yeah, me too.&lt;/p&gt;

&lt;p&gt;Here are the 7 ways to completely center whatever you want with CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;1. text-align: center;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This works only on &lt;code&gt;display: inline&lt;/code&gt; &amp;amp; &lt;code&gt;display: inline-block&lt;/code&gt; elements. Note also that it must be applied to the parent element.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3s2cf83jcl80t1bvkvj.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3s2cf83jcl80t1bvkvj.png" alt="Centering images and text with text-align: center css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;2. margin: 0 auto;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This works only on &lt;code&gt;display: block&lt;/code&gt; elements. And the element must have a width. &lt;/p&gt;

&lt;p&gt;You can also specify just &lt;code&gt;margin-left: auto&lt;/code&gt; and &lt;code&gt;margin-right: auto&lt;/code&gt; if you want margins on the top or bottom.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qn1ukzmjdwlwlfx0z7q.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qn1ukzmjdwlwlfx0z7q.png" alt="Centering elements inside a div with margin: 0 auto css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;3. vertical-align: middle;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This works only on &lt;code&gt;display: inline&lt;/code&gt; &amp;amp; &lt;code&gt;display: inline-block&lt;/code&gt; elements.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizjek6gpt9z9w44l54ov.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizjek6gpt9z9w44l54ov.png" alt="Centering elements inside a list with vertical-align: middle css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;4. float: center;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;lol (You cannot center floated elements.)&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmaojxdh727cnyhqse4aq.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmaojxdh727cnyhqse4aq.png" alt="It's impossible to both horizontally and vertically center an element with float: center css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;5. Centering absolute&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When this comes up, use &lt;code&gt;transform&lt;/code&gt; and &lt;code&gt;50%&lt;/code&gt; coordinates to center an absolutely positioned element.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ia7j5deozist5z6wr09.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ia7j5deozist5z6wr09.png" alt="Centering child divs of a position: relative parent div with css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;6. Centering with flexbox&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Flexbox has a bunch of different alignment classes that are always applied to the parent. This here will be completely centered within the box.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2jejajip6lb2707df4s.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2jejajip6lb2707df4s.png" alt="Centering elements inside a div with flexbox css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;7. the one I forgot ;-)&lt;/code&gt;
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibn1xbzzst34jfvmvp9n.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibn1xbzzst34jfvmvp9n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Jamstack Setups: The good, the bad, the ugly.</title>
      <dc:creator>Ryland @ Stackbit</dc:creator>
      <pubDate>Mon, 11 Oct 2021 19:00:49 +0000</pubDate>
      <link>https://dev.to/stackbit/jamstack-setups-the-good-the-bad-the-ugly-jj</link>
      <guid>https://dev.to/stackbit/jamstack-setups-the-good-the-bad-the-ugly-jj</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--97WnWnoU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/calh583sujti4i95kdwa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--97WnWnoU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/calh583sujti4i95kdwa.png" alt="Jamstack Setups Pros &amp;amp; Cons"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Guide on Transforming an Idea into a Website</title>
      <dc:creator>Sean C Davis</dc:creator>
      <pubDate>Thu, 09 Sep 2021 18:42:32 +0000</pubDate>
      <link>https://dev.to/stackbit/a-guide-on-transforming-an-idea-into-a-website-4oco</link>
      <guid>https://dev.to/stackbit/a-guide-on-transforming-an-idea-into-a-website-4oco</guid>
      <description>&lt;p&gt;At its core, Jamstack was a revolution. It took the best part of the first 25+ years of website development and combined them into a powerful pattern that is used widely today. It has created an explosion of ideas and innovations that have helped developers across the world build websites that are more performant, more secure, less expensive, easier to scale, and (most importantly) fun to build!&lt;/p&gt;

&lt;p&gt;Instead of taking you on a theoretical journey and digging into the technical nuances of the Jamstack, we're going someplace else. We'll take a more tangible journey, as we step through the entire process of building a Jamstack website, from the little light bulb in your brain all the way to a physical website that real people can visit.&lt;/p&gt;

&lt;p&gt;These are the stops we'll make along the way:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Bring the design to life&lt;/li&gt;
&lt;li&gt;Find a developer&lt;/li&gt;
&lt;li&gt;Build the site (write the code)&lt;/li&gt;
&lt;li&gt;Review and test the site&lt;/li&gt;
&lt;li&gt;Deploy, edit, and repeat, repeat, repeat&lt;/li&gt;
&lt;li&gt;Or ... do it the Stackbit way!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Buckle up. Here we go!&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop #1: Design
&lt;/h2&gt;

&lt;p&gt;The first stop on the Jamstack journey is design — the process of visually representing your ideas.&lt;/p&gt;

&lt;h3&gt;
  
  
  From Spec to Delivery
&lt;/h3&gt;

&lt;p&gt;The way this typically works is that you provide some form of &lt;em&gt;spec&lt;/em&gt; to a designer. The designer then takes that spec and turns it into one or more design files that show what should be built. That can include page layouts, individual components, or global patterns like colors, fonts, and typography.&lt;/p&gt;

&lt;h3&gt;
  
  
  Delivering a Good Spec
&lt;/h3&gt;

&lt;p&gt;The “spec” you provide the designer should be more then, “I need a website.” Before you bring a designer into your project, consider spending time to gather the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  A list of pages on the site, along with the purpose of each page. Bonus points if you also include content, as you'll reduce the variability of the design when it is transformed into code.&lt;/li&gt;
&lt;li&gt;  Brand assets or other visual specifications you have — logos, colors, typography, etc.&lt;/li&gt;
&lt;li&gt;  A list of websites that you really like and why you like them. The designer will want you to be happy, and the more you can tell them what you like, the higher the chance that they will deliver on your vision.&lt;/li&gt;
&lt;li&gt;  A list of competitors. Even if the designer doesn't use inspiration from your competitors' sites, it's nice for them to know where the competition stands and what it'll take to be noticed in the crowd.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The designer may ask you for more information, but this is a good start to get the conversation rolling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Locating the Right Designer
&lt;/h3&gt;

&lt;p&gt;If you have a designer already working with you, that's a bonus! If not, the cost and abilities of designers vary &lt;em&gt;widely&lt;/em&gt;. You could use a service like &lt;a href="https://www.fiverr.com/" rel="noopener noreferrer"&gt;Fiverr&lt;/a&gt; and have a decent-sized website designed for a few hundred dollars (USD). Or you could hire a fancy agency and spend tens of thousands of dollars.&lt;/p&gt;

&lt;p&gt;Generally speaking, cost tends to be &lt;em&gt;somewhat&lt;/em&gt; proportional to experience and the quality you're going to get back. But that doesn't mean the inexpensive designer is going to provide an awful design. This is how I usually think about it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  If I hire a designer on the cheap, I'm going to have to do more work if I want to get something worthwhile out of it. I'll have to drive the process. I'll have to deliver a super tight spec so that they give me exactly what I'm looking for.&lt;/li&gt;
&lt;li&gt;  If I hire a fancy and expensive firm, I should expect to still have to put in time and effort, but should be led through the process and be left with something truly great.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Looking Toward Development
&lt;/h3&gt;

&lt;p&gt;What's interesting about this process is that while design tends to be a fraction of the cost of development, it's also largely responsible for determining the complexity of the build. Granted, a developer can spend your money in a silly way and &lt;em&gt;over-engineer&lt;/em&gt; a website for you. But, &lt;em&gt;most of the time&lt;/em&gt;, the time a developer is going to spend building your site is determined by &lt;em&gt;their specification&lt;/em&gt; — the design files.&lt;/p&gt;

&lt;p&gt;The more interactive the design, the more it's going to cost to develop. The more unique each page is from the others, the more it's going to cost to develop.&lt;/p&gt;

&lt;p&gt;You don't have to be a fortune teller. Instead, leave a little room in your budget for going back to the designer after consulting with your developer. If the developer says you can save a thousand dollars by changing a feature, maybe you'd want to spend another hundred to have the designer reimagine and simplify it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Deliverable
&lt;/h3&gt;

&lt;p&gt;After going through the design phase, you're left with the &lt;em&gt;deliverables&lt;/em&gt; — artifacts you can pass on to the developer as their specification. &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/main/01-design" rel="noopener noreferrer"&gt;Here's an example for a simple site&lt;/a&gt; that includes just four files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://raw.githubusercontent.com/seancdavis/stackbit-jamstack-journey/main/01-design/unmute--homepage--desktop.png" rel="noopener noreferrer"&gt;Home page for large screens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://raw.githubusercontent.com/seancdavis/stackbit-jamstack-journey/main/01-design/unmute--homepage--mobile.png" rel="noopener noreferrer"&gt;Home page for small screens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://raw.githubusercontent.com/seancdavis/stackbit-jamstack-journey/main/01-design/unmute--content-page.png" rel="noopener noreferrer"&gt;Interior pages&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://raw.githubusercontent.com/seancdavis/stackbit-jamstack-journey/main/01-design/unmute--style-tiles.png" rel="noopener noreferrer"&gt;Style tiles&lt;/a&gt; (i.e. global style definitions)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And this is an example of what a style tiles spec might look like:&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%2Fraw.githubusercontent.com%2Fseancdavis%2Fstackbit-jamstack-journey%2Fmain%2F01-design%2Funmute--style-tiles.png" 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%2Fraw.githubusercontent.com%2Fseancdavis%2Fstackbit-jamstack-journey%2Fmain%2F01-design%2Funmute--style-tiles.png" alt="An example of style tiles — styles that apply to all (or most) pages on the site"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(This example is from &lt;a href="https://www.unmutedstories.com/" rel="noopener noreferrer"&gt;Unmute&lt;/a&gt;, a side project I'm involved with.)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Stops #2-4: Development
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Toot toot!&lt;/em&gt; This train keeps on rolling. The next several steps encompass the development phase of the project. Our Jamstack train makes three stops here because there are &lt;em&gt;usually&lt;/em&gt; three steps in this process, though the amount to which you are involved in each will vary depending on the developer you hire.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Process
&lt;/h3&gt;

&lt;p&gt;This process itself is similar to the design process in that it goes through these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Locate &amp;amp; Estimate:&lt;/strong&gt; Developer provides estimate based on specification.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build:&lt;/strong&gt; Developer &lt;em&gt;builds&lt;/em&gt; the site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review:&lt;/strong&gt; The developer delivers the code and you review to make sure it works.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Locate a Developer
&lt;/h3&gt;

&lt;p&gt;You can go through much the same process as you did with design. If you have an in-house developer, great! If not, you can use a service like Fiverr and hire devs on the cheap. Or you can look to a more formal agency or dev shop to suit your needs.&lt;/p&gt;

&lt;p&gt;In this case, you don't have to build a spec for the developer. You already did that! The design files are your specification.&lt;/p&gt;

&lt;p&gt;Finding the right developer is crucial to this process, as well. And that's why I've broken out the build portion (below) as three steps. Some developers (usually those you hire on the cheap) may only complete the first step in the process. But for you to truly achieve a useful and powerful Jamstack site, you'll want someone who can take you through all three.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Build
&lt;/h3&gt;

&lt;p&gt;These are the steps in the process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Static build&lt;/li&gt;
&lt;li&gt;Templatizing the code&lt;/li&gt;
&lt;li&gt;Separating content from presentation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can spend very little on web development and still get something that you can deploy out of it. Often, that means the developer only went through the first step and gave you static files. That's totally fine, but it will make adding new pages or editing existing content super difficult.&lt;/p&gt;

&lt;p&gt;The second step — &lt;em&gt;templatizing&lt;/em&gt; — aims to take the static code and turn it into modular pieces that can be reused. This process is explained in great length and technical detail &lt;a href="https://www.stackbit.com/blog/jamstack-journey-templatize-static-html/" rel="noopener noreferrer"&gt;in this guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After the code has been modularized, it can be further adjusted to extract all the content and put it in a single place, such as a content management system. This process is explained in great length &lt;a href="https://www.stackbit.com/blog/jamstack-journey-separate-content/" rel="noopener noreferrer"&gt;in this guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And the end of these three steps, you'll be left with a system that you can use to edit content without worrying about messing up the code. In fact, you ought to be able to edit the content without even &lt;em&gt;seeing&lt;/em&gt; the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reviewing the Site
&lt;/h3&gt;

&lt;p&gt;While the review process for design was more conceptual, with development, it's up to you to actually test that the website behaves as you'd expect. In other words, you're &lt;em&gt;trying to break it&lt;/em&gt;. The developer should respond by fixing any bugs discovered within a certain timeframe.&lt;/p&gt;

&lt;p&gt;While the developer may not &lt;em&gt;deploy&lt;/em&gt; the code for you, they ought to be able to help you get it running so that you can test and send notes back to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop #5: Deploy &amp;amp; Use!
&lt;/h2&gt;

&lt;p&gt;At this point you have a site that is ready to go to production, so that's the next step. I recommend using that same developer to help you through that process, but I've broken it out here because it tends to require more effort from you than the development phase of the project.&lt;/p&gt;

&lt;p&gt;Here are a few of the crucial steps in this process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Choose a host and setup an account&lt;/li&gt;
&lt;li&gt;  Buy and/or configure a domain name&lt;/li&gt;
&lt;li&gt;  Add analytics tooling&lt;/li&gt;
&lt;li&gt;  Add SEO content&lt;/li&gt;
&lt;li&gt;  Use it!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at each of these briefly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hosting
&lt;/h3&gt;

&lt;p&gt;The term "Jamstack" was coined by a startup called &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;. And they continue to lead the way in terms of deploying and hosting Jamstack websites. But there are other great tools out there, like &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;, &lt;a href="https://pages.github.com/" rel="noopener noreferrer"&gt;GitHub Pages&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/en-us/services/app-service/static/" rel="noopener noreferrer"&gt;Azure Static Web Apps&lt;/a&gt;, and many more.&lt;/p&gt;

&lt;p&gt;Whatever you choose, you'll want to set up an account for yourself. Most of these services have a free (or low cost) tier that is enough to accommodate small websites.&lt;/p&gt;

&lt;p&gt;Once you have an account, you can add your developer, and they will hook it up so that the code is deployed. And then you will have a working website!&lt;/p&gt;

&lt;h3&gt;
  
  
  Domain
&lt;/h3&gt;

&lt;p&gt;You'll want a domain name for your site, otherwise you'll be left with default names from your hosting provider. If you already have one, that's great!&lt;/p&gt;

&lt;p&gt;Your developer can tell you what you need to do to point the domain to your host, and then you'll be able to use your domain name to access your new website!&lt;/p&gt;

&lt;h3&gt;
  
  
  Analytics
&lt;/h3&gt;

&lt;p&gt;Analytics is a crucial piece of the puzzle, because you want to know who is visiting your website. Some hosting providers (like Netlify) offer what they call server-side analytics, which tend to be the most accurate, though there are limitations to them. But if you're just getting started, it's easy enough to start with &lt;a href="https://marketingplatform.google.com/about/analytics/" rel="noopener noreferrer"&gt;Google Analytics&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Tell your developer you want to install Google Analytics and they can help you through that process.&lt;/p&gt;

&lt;h3&gt;
  
  
  SEO
&lt;/h3&gt;

&lt;p&gt;Of all these pre-launch steps, perhaps the trickiest to deal with is SEO. Usually I'd expect a developer to prepare my site to support SEO. That means automatically generating a sitemap file and providing the ability to customize SEO meta values for any given page. (It would be worthwhile to mention this when first setting up the arrangement with the developer so that they are prepared.)&lt;/p&gt;

&lt;p&gt;You'll want to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Register your site (and sitemap) with &lt;a href="https://developers.google.com/search" rel="noopener noreferrer"&gt;Google Search Console&lt;/a&gt;. This will help provide you with analytics on where you land in search results. It'll also help Google know where your site is and what its pages are.&lt;/li&gt;
&lt;li&gt;Add custom SEO values for every page on your site, including adding an image.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you don't feel confident in this step, you can also hire an SEO expert to help you through the process. These types of consultants also have a huge price range, from Fiverr to big agency. If you're just getting started, I recommend toward the cheaper option — just have someone give you a quick audit and make the changes they suggest.&lt;/p&gt;

&lt;p&gt;(Insider secret: Mostly what these SEO pros are doing is using some expensive tool, hooking up your site, running a report, and giving you the output of that report. The funny thing is, some of the people are often less expensive than buying the tools and doing the work yourself.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Editing
&lt;/h3&gt;

&lt;p&gt;When all of those last bits are in place, you should have a live site and it's time to start promoting it and keeping it up to date. Make a few changes to the content. Tell the world about it. and give yourself a pat on the back.&lt;/p&gt;

&lt;p&gt;BUT WAIT! Before we wrap this up, I want to spend a little time giving you what I think is a better way to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop #6: An Easier Approach
&lt;/h2&gt;

&lt;p&gt;If you're new to the world of creating websites, I think you should take a look at &lt;a href="https://www.stackbit.com/" rel="noopener noreferrer"&gt;Stackbit&lt;/a&gt;! (Of course I do, I work there and am writing on their blog.)&lt;/p&gt;

&lt;p&gt;Stackbit is a site builder that specializes in Jamstack websites.&lt;/p&gt;

&lt;p&gt;Instead of going through that entire process (the first five stops on the Jamstack journey), you could do it all yourself in much less time for much less money. After &lt;a href="https://app.stackbit.com/login" rel="noopener noreferrer"&gt;creating an account&lt;/a&gt;, Stackbit will give you a list of templates from which you can build your site. You'll then walk through the process of customizing it just for you.&lt;/p&gt;

&lt;p&gt;The catch here is that Stackbit isn't just another WordPress or Squarespace, even though it may feel like it at first. Stackbit works to be super transparent about where your code and content live. What that means is that you can start this journey on your own, without a designer or a developer, at no cost other than your time. And you'll still have access to the code and content that powers your site. Once you're up and running, if you need a little help, &lt;em&gt;that's&lt;/em&gt; when you can bring in a designer, developer, or SEO expert to make some suggestions or additions to your new site.&lt;/p&gt;

&lt;p&gt;If that sounds like a walk in the park, &lt;a href="https://app.stackbit.com/create" rel="noopener noreferrer"&gt;give it a try&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;In any case, I hope you've enjoyed your ride, and I'd love to learn more about your &lt;em&gt;Jamstack Journey&lt;/em&gt;. &lt;a href="https://twitter.com/seancdavis29" rel="noopener noreferrer"&gt;Let's chat&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>jamstack</category>
      <category>design</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Separate Content from Website Code for Easier Editing</title>
      <dc:creator>Sean C Davis</dc:creator>
      <pubDate>Tue, 24 Aug 2021 18:10:55 +0000</pubDate>
      <link>https://dev.to/stackbit/separate-content-from-website-code-for-easier-editing-1ig3</link>
      <guid>https://dev.to/stackbit/separate-content-from-website-code-for-easier-editing-1ig3</guid>
      <description>&lt;p&gt;When it comes to turning a website design into a real thing (a website), a static site generator is an invaluable tool. It provides you with the ability to abstract reusable parts so you can write code more efficiently and more accurately.&lt;/p&gt;

&lt;p&gt;We covered the process of moving from static HTML files to a &lt;a href="https://www.seancdavis.com/blog/wtf-is-ssg/" rel="noopener noreferrer"&gt;static site generator&lt;/a&gt; (SSG) &lt;a href="https://www.stackbit.com/blog/jamstack-journey-templatize-static-html/" rel="noopener noreferrer"&gt;in the precursor to this article&lt;/a&gt;. Here we're going to look at taking your SSG game to the next level by transforming it into content-driven engine. Together, these two steps make up a few parts of &lt;em&gt;The Jamstack Journey&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  How a Content-Driven Website Works
&lt;/h2&gt;

&lt;p&gt;There are two main steps in the process of transforming a templatized site into one that is content-driven:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Separate content from presentation&lt;/li&gt;
&lt;li&gt;Abstract repeatable components&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Separate Content from Presentation
&lt;/h3&gt;

&lt;p&gt;The first step in the process is to separate content from presentation. Your templatized website likely has a number of HTML files representing the content of your site. (In our templatized example, we also used &lt;code&gt;.njk&lt;/code&gt; files.)&lt;/p&gt;

&lt;p&gt;For example, you might have a blog post represented as &lt;code&gt;my-first-post.html&lt;/code&gt; that looks something 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%2Fwww.stackbit.com%2Fimages%2F210824--post-after-templatizing.png" class="article-body-image-wrapper"&gt;&lt;img alt="Blog post after templatizing" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.stackbit.com%2Fimages%2F210824--post-after-templatizing.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It doesn't have any layout elements because those have all been abstracted away in your template, but it still has HTML code, which effects the structure — the &lt;em&gt;presentation&lt;/em&gt; — of the page.&lt;/p&gt;

&lt;p&gt;Converting this to a content driven approach means we can convert the HTML file into a content-based file, like markdown (e.g. &lt;code&gt;my-first-post.md&lt;/code&gt;). And then that content can be fed into the main post layout. 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%2Fwww.stackbit.com%2Fimages%2F210824--after-transformation.png" class="article-body-image-wrapper"&gt;&lt;img alt="Blog-post after content-driven transformation" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.stackbit.com%2Fimages%2F210824--after-transformation.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this doesn't make sense, don't worry yet. We're going to go through a real-world example.&lt;/p&gt;

&lt;h3&gt;
  
  
  Abstract Repeatable Components
&lt;/h3&gt;

&lt;p&gt;This process forces us to develop a &lt;em&gt;shape&lt;/em&gt; for our content. Doing so will help us uncover opportunities to further simplify templates by combining and abstracting repeatable structures. If this also has your head spinning, it's okay. We'll look at an example of this in action, too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of a Content-Driven Website
&lt;/h2&gt;

&lt;p&gt;The process of separating content from presentation has a number of benefits. These are the primary reasons I go through through this effort:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It reduces the potential for introducing new bugs through content. When you force your editors to write HTML code just to add content to your site, you are greatly increasing your risk for new bugs that come from unexpected or bad HTML code.&lt;/li&gt;
&lt;li&gt;Less technical content editors can contribute without learning code.&lt;/li&gt;
&lt;li&gt;It's more pleasant to author content. Markdown is built to get out of your way. Instead of wrapping a top-level heading in an &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tag, you just precede the line with &lt;code&gt;#&lt;/code&gt;. There are no paragraph tags — they are inferred.&lt;/li&gt;
&lt;li&gt;Markdown is faster to write, too! (At least once you get the hang of it.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What about Content Management Systems?
&lt;/h2&gt;

&lt;p&gt;If we're talking about separating content from presentation, shouldn't we be talking about content management systems (CMS), too?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Great question, Sean.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Yes, this would be the perfect time to introduce a CMS into your project. What we're doing here is substituting a more formal CMS with markdown files. Think of markdown files as the data coming from your CMS. In fact, you could technically pull content from a CMS &lt;em&gt;and&lt;/em&gt; convert it to markdown files. I like this approach because a) it's simpler than wiring up a whole CMS, but b) can still work well with your setup if you choose to use a CMS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: The Templatized Site
&lt;/h2&gt;

&lt;p&gt;With that, let's get started!&lt;/p&gt;

&lt;p&gt;Following the templatizing tutorial, we were left with &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/6e9cb47140e5818b7b97ff314b8f89f9162b88ed/03-templated-site" rel="noopener noreferrer"&gt;this code&lt;/a&gt;. That's where we're going to begin for this exercise.&lt;/p&gt;

&lt;p&gt;Add the contents of the example templatized project to some directory on your machine. &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/archive/refs/tags/v1-draft.zip" rel="noopener noreferrer"&gt;Here's a link to download the larger example&lt;/a&gt;. After doing that, you can find the appropriate files in the &lt;code&gt;03-templated-site&lt;/code&gt; directory. Move these files into a new directory on your machine. Your folder's contents &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/5c82f41/04-content-driven-site" rel="noopener noreferrer"&gt;should look like this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now we're ready to get started. We're going to do a series of abstractions to get to our final content-driven site. What we'll focus on below are four steps that represent a smaller part of a larger effort. The code I'll share in the end will have made more abstractions, but we'll aim to arm you with the tools you need to get there.&lt;/p&gt;

&lt;p&gt;To make sure everything is in order before we get going, it'd be safe to reinstall your dependencies and then start the development server.&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;Then visit localhost:8000 in your browser and you should see the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Simplify Pages
&lt;/h2&gt;

&lt;p&gt;The easiest step in this process is setting up our interior pages. Right now, our privacy and terms pages are &lt;code&gt;.njk&lt;/code&gt; files, which means they are littered with HTML code. The beauty of Eleventy is that if we simply change the file extension in these files to &lt;code&gt;.md&lt;/code&gt; they will work immediately.&lt;/p&gt;

&lt;p&gt;Give it a try. Rename &lt;code&gt;privacy.njk&lt;/code&gt; to &lt;code&gt;privacy.md&lt;/code&gt; and &lt;code&gt;terms.njk&lt;/code&gt; to &lt;code&gt;terms.md&lt;/code&gt;. Notice that you don't even have to do anything and they work perfectly fine! That's the magic of markdown. Technically, HTML is valid markdown code.&lt;/p&gt;

&lt;p&gt;But, even though it works, we have an opportunity to drastically simplify this content by removing the HTML. I ran the HTML code &lt;a href="https://www.browserling.com/tools/html-to-markdown" rel="noopener noreferrer"&gt;through an online converter&lt;/a&gt;. You could do the same or you could reference the new files (&lt;a href="https://raw.githubusercontent.com/seancdavis/stackbit-jamstack-journey/63eb311e7d6a0bbd8f4d942ecbc9a8bb4b8997a2/04-content-driven-site/terms.md" rel="noopener noreferrer"&gt;Terms here&lt;/a&gt;, and &lt;a href="https://raw.githubusercontent.com/seancdavis/stackbit-jamstack-journey/63eb311e7d6a0bbd8f4d942ecbc9a8bb4b8997a2/04-content-driven-site/privacy.md" rel="noopener noreferrer"&gt;Privacy here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Notice that the little YAML markdown snippet at the top of these files did not change.&lt;/strong&gt; That piece is still relevant so that Eleventy knows which template to use and how to pass on the title of each page to that template.&lt;/p&gt;

&lt;p&gt;After these changes, your code &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/63eb311/04-content-driven-site" rel="noopener noreferrer"&gt;should look like this&lt;/a&gt; and you should be able to visit localhost:8000/terms and localhost:8000/privacy with both looking as they did before you made the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Shared Global Data
&lt;/h2&gt;

&lt;p&gt;We could jump to the home page next, but that one is a doozy, so let's move on to something a little simpler first — shared global data. There is often content that you want to share across multiple pages or templates. Eleventy is built to support this with its &lt;a href="https://www.11ty.dev/docs/data-global/" rel="noopener noreferrer"&gt;global data files&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One example I see in looking at the site as it is right now are the details about the next event. So what I would do is place these details in their own data file in &lt;code&gt;_data/next_event.json&lt;/code&gt;. Create that file and add the details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"October 1, 2021"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7 PM ET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"location"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Virtual"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Free"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're using these in two places today — the home page jumbotron and the header in the content page. Since both files (&lt;code&gt;index.njk&lt;/code&gt; and &lt;code&gt;_includes/content-page.njk&lt;/code&gt;) are using the Nunjucks templating language, you can render this value using a &lt;a href="https://mozilla.github.io/nunjucks/templating.html#variables" rel="noopener noreferrer"&gt;Nunjucks variable&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For example, the code in the content page template would look 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;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hidden lg:inline-block lg:mr-2 xl:mr-3"&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ next_event.date }}&lt;span class="nt"&gt;&amp;lt;/span&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hidden lg:inline-block lg:mx-2 xl:mx-3"&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ next_event.time }}&lt;span class="nt"&gt;&amp;lt;/span&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hidden xl:inline-block lg:mx-2 xl:mx-3"&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ next_event.location }}&lt;span class="nt"&gt;&amp;lt;/span&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hidden lg:inline-block lg:mx-2 xl:mx-3"&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ next_event.cost }}&lt;span class="nt"&gt;&amp;lt;/span&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The home page can follow a similar pattern. &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/commit/737599767da0ce5ad044985499811dd1d76c01bb" rel="noopener noreferrer"&gt;Here is a summary of the changes I made&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It's a good idea to keep this pattern in mind and employ it whenever you find opportunities to share &lt;em&gt;content&lt;/em&gt; (not code) among multiple pages or templates. For example, another use case might be to build a list of social media account URLs so that you can separate the links from the markup and style of the icons.&lt;/p&gt;

&lt;p&gt;Give your browser another look to make sure that those values were updated as you'd expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: The Home Page
&lt;/h2&gt;

&lt;p&gt;Let's take a look at the home page next. We won't abstract this in quite the same way as the interior pages. This is because when we templatized the site, we used a super generic template and put all the unique stuff directly in the home page.&lt;/p&gt;

&lt;p&gt;What we want to do here is now extract the content from the home page so that it is trivial to edit without scrolling through the hundreds of lines of code. But we're in a good position to do that.&lt;/p&gt;

&lt;p&gt;First, move your &lt;code&gt;index.njk&lt;/code&gt; file to &lt;code&gt;_includes/home.njk&lt;/code&gt;. Doing this effectively removes our home page. We still need that index page. But now we want it to be a content page. So let's create a new file in the root of the project and call in &lt;code&gt;index.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Refresh your browser and see that there's nothing there! That's because Eleventy is now reading this as your home page, but there's no content and you haven't specified a layout. So let's do that. Change the file to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;home&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now refresh your browser and we're back.&lt;/p&gt;

&lt;p&gt;Then we can move through the file meticulously and extract elements one at a time until we have separated all our content from the template.&lt;/p&gt;

&lt;p&gt;For example, say we wanted to adjust the copy under "Unmute yours" in the jumbotron.&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%2Fwww.stackbit.com%2Fimages%2F210824--unmute-jumbotron.png" 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%2Fwww.stackbit.com%2Fimages%2F210824--unmute-jumbotron.png" alt="Unmute website jumbotron"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Maybe we make a new object for &lt;code&gt;jumbotron&lt;/code&gt; and then add a &lt;code&gt;body&lt;/code&gt; section to it. Your &lt;code&gt;index.md&lt;/code&gt; file would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;home&lt;/span&gt;
&lt;span class="na"&gt;jumbotron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|-&lt;/span&gt;
    &lt;span class="s"&gt;Join us for an evening of storytelling with some of your favorite fellow&lt;/span&gt;
    &lt;span class="s"&gt;nerds. We'll laugh. We'll cry. We may even hear a story without any&lt;/span&gt;
    &lt;span class="s"&gt;industry jargon!&lt;/span&gt;
&lt;span class="s"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you could replace the section in &lt;code&gt;_includes/home.njk&lt;/code&gt; to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"max-w-md mb-8 mx-auto md:mx-0"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;jumbotron&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a long and often tedious process, but it's a game-changer when it comes to editing your site down the road. I'll leave the rest up to you and share where I ended up after going through the exercise. But first I want to talk about the process of abstracting components.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Abstracting Components
&lt;/h2&gt;

&lt;p&gt;Extracting content from your pages and templates requires that you define the structure of your data. In Step 4, we could see the beginning of that structure — e.g. &lt;code&gt;jumbotron&lt;/code&gt; was going to be its own section, presumably with multiple properties within it.&lt;/p&gt;

&lt;p&gt;The resulting structure can help you determine where you can tighten up your template code further by looking for repeatable patterns.&lt;/p&gt;

&lt;p&gt;For example, in this home page, each of the speakers has a similar shape to its content. So, even though you could define each speaker individually, it probably makes sense to develop a repeatable pattern, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;speakers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Speaker Name&lt;/span&gt;
    &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Title / Company&lt;/span&gt;
    &lt;span class="na"&gt;fun_fact&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Fun Fact&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/images/speakers/speaker-01.png&lt;/span&gt;
    &lt;span class="na"&gt;social&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
      &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
      &lt;span class="na"&gt;instagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Speaker Name&lt;/span&gt;
    &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Title / Company&lt;/span&gt;
    &lt;span class="na"&gt;fun_fact&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Fun Fact&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/images/speakers/speaker-02.png&lt;/span&gt;
    &lt;span class="na"&gt;social&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
      &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Speaker Name&lt;/span&gt;
    &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Title / Company&lt;/span&gt;
    &lt;span class="na"&gt;fun_fact&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Fun Fact&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/images/speakers/speaker-03.png&lt;/span&gt;
    &lt;span class="na"&gt;social&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Speaker Name&lt;/span&gt;
    &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Title / Company&lt;/span&gt;
    &lt;span class="na"&gt;fun_fact&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Fun Fact&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/images/speakers/speaker-04.png&lt;/span&gt;
    &lt;span class="na"&gt;social&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
      &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
      &lt;span class="na"&gt;instagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;#"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This repeatable pattern hints that we could also abstract the code. Instead of having individual HTML for each speaker, we could create another &lt;em&gt;include&lt;/em&gt; template and render the content of each speaker.&lt;/p&gt;

&lt;p&gt;Our &lt;code&gt;_includes/home.njk&lt;/code&gt; file would include this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-{{ lineup.speakers.length }}"&amp;gt;
  {% for speaker in speakers %}
    {% include "speaker.njk" %}
  {% endfor %}
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then &lt;code&gt;_includes/speaker.njk&lt;/code&gt; could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="mx-4 mb-8 lg:mb-0 template-home--speaker"&amp;gt;
  &amp;lt;span class="block mb-2"&amp;gt;
    &amp;lt;img src="{{ speaker.image }}" alt=""/&amp;gt;
  &amp;lt;/span&amp;gt;
  &amp;lt;strong class="block mb-2 text-lg"&amp;gt;{{ speaker.name }}&amp;lt;/strong&amp;gt;
  &amp;lt;span class="block text-sm"&amp;gt;
    &amp;lt;em&amp;gt;{{ speaker.position }}&amp;lt;/em&amp;gt;
  &amp;lt;/span&amp;gt;
  &amp;lt;span class="block text-sm"&amp;gt;{{ speaker.fun_fact }}&amp;lt;/span&amp;gt;

  &amp;lt;div class="flex items-center justify-center mt-4"&amp;gt;
    {% if speaker.social.twitter %}
      &amp;lt;a href="{{ speaker.social.twitter }}" class="mx-1 hover:opacity-75 transition-all duration-300"&amp;gt;
        &amp;lt;span class="inline-block bg-red text-white rounded-full p-2 overflow-hidden h-8 w-8 component--icon"&amp;gt;
          {% include "svg/twitter.svg" %}
        &amp;lt;/span&amp;gt;
      &amp;lt;/a&amp;gt;
    {% endif %}
    {% if speaker.social.facebook %}
      &amp;lt;a href="{{ speaker.social.facebook }}" class="mx-1 hover:opacity-75 transition-all duration-300"&amp;gt;
        &amp;lt;span class="inline-block bg-red text-white rounded-full p-2 overflow-hidden h-8 w-8 component--icon"&amp;gt;
          {% include "svg/facebook.svg" %}
        &amp;lt;/span&amp;gt;
      &amp;lt;/a&amp;gt;
    {% endif %}
    {% if speaker.social.instagram %}
      &amp;lt;a href="{{ speaker.social.instagram }}" class="mx-1 hover:opacity-75 transition-all duration-300"&amp;gt;
        &amp;lt;span class="inline-block bg-red text-white rounded-full p-2 overflow-hidden h-8 w-8 component--icon"&amp;gt;
          {% include "svg/instagram.svg" %}
        &amp;lt;/span&amp;gt;
      &amp;lt;/a&amp;gt;
    {% endif %}
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's 30-some lines of HTML, instead of more than 100! And if you want to change the presentation of a speaker, you only have to change it in one place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/commit/b12ed710e55919ce73181c85f110c5ec027eac9a" rel="noopener noreferrer"&gt;Here are the changes I made to the home page&lt;/a&gt;. And &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/b12ed71/04-content-driven-site" rel="noopener noreferrer"&gt;here is what the resulting code looks like&lt;/a&gt;. At this point, you have a website that is not just easy to edit its structure or presentation, but it's also trivial to create new pages or adjust values on the home page without searching through a bunch of HTML code to get there.&lt;/p&gt;

&lt;p&gt;Go ahead, try it! Create a new &lt;code&gt;.md&lt;/code&gt; file. Give it a &lt;code&gt;content-page&lt;/code&gt; layout (like Terms and Privacy) and &lt;code&gt;title&lt;/code&gt;, then see it come to life!&lt;/p&gt;

&lt;p&gt;Now that you now how to templatize a static HTML site &lt;em&gt;and&lt;/em&gt; you can separate its content from presentation, you have two very important tools necessary to create rock solid websites with the Jamstack.&lt;/p&gt;

</description>
      <category>markdown</category>
      <category>cms</category>
      <category>jamstack</category>
      <category>eleventy</category>
    </item>
    <item>
      <title>How to Convert Static HTML into Powerful Templates</title>
      <dc:creator>Sean C Davis</dc:creator>
      <pubDate>Tue, 10 Aug 2021 17:54:52 +0000</pubDate>
      <link>https://dev.to/stackbit/how-to-convert-static-html-into-powerful-templates-373i</link>
      <guid>https://dev.to/stackbit/how-to-convert-static-html-into-powerful-templates-373i</guid>
      <description>&lt;p&gt;You've gone through the design process in building a website, but now you're left with a handful of HTML files, along with some images and one or more CSS and JavaScript files, and you want to know what to do with them? Great! Let's talk about it.&lt;/p&gt;

&lt;p&gt;You &lt;em&gt;could&lt;/em&gt; deploy (i.e. publish) them, and eventually you will, otherwise no one will see your site. But deploying at this point is only going to get you so far. Inevitably, you’re going to want to change something with the site, and then what? Are you going to go all the way through the design process again? That sounds … &lt;em&gt;painful.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A more sustainable approach is to take the static HTML content you were given and &lt;em&gt;templatize it!&lt;/em&gt; Make it easier for you to work with — to make changes and to create new pages — when the need arises.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why templatize a website?
&lt;/h2&gt;

&lt;p&gt;This process has one major benefit — &lt;em&gt;reusability&lt;/em&gt;. It makes the act of adjusting structure or content relatively trivial when compared with having to work with individual HTML files. That process can be further enhanced by separating content from presentation, so that when all you need to do is change a few words, you know right where to go and never have to mess with any of the code. (We have a detailed guide for that, but you’ll want to follow this one first.)&lt;/p&gt;

&lt;p&gt;Consider two typical and simple content pages that most sites have — &lt;em&gt;Terms &amp;amp; Conditions&lt;/em&gt; and &lt;em&gt;Privacy Policy&lt;/em&gt;. They often have the same header and footer. It’s just the content in the middle of the page that differs (though the &lt;em&gt;structure&lt;/em&gt; is likely similar). With those pages as separate HTML files, when you want to change something in a shared section — like the header or footer — you have to make the change in both places.&lt;/p&gt;

&lt;p&gt;Expand that example to a site that has hundreds of pages with a similar structure (like blog posts). You’d be making that change hundreds or &lt;em&gt;thousands&lt;/em&gt; of times, depending on the size of your site.&lt;/p&gt;

&lt;p&gt;Following a software development principle called &lt;a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself"&gt;&lt;em&gt;don’t repeat yourself&lt;/em&gt;&lt;/a&gt; (often referred to as &lt;em&gt;DRY code&lt;/em&gt;), you could build the site with reusable pieces. Then you can make each change once and have it work everywhere. This is the magic of templatizing.&lt;/p&gt;

&lt;h2&gt;
  
  
  How templatizing works
&lt;/h2&gt;

&lt;p&gt;When you have no templates and only HTML, the code on each page is unique and lives within its own file. Take a super simple site that has a home page (&lt;code&gt;index.html&lt;/code&gt;), along with Terms (&lt;code&gt;terms.html&lt;/code&gt;) and Privacy (&lt;code&gt;privacy.html&lt;/code&gt;) pages. Your files look like this, where the dark blue boxes represent the code unique to each page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u9VnzgiR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--templatizing-before.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u9VnzgiR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--templatizing-before.png" alt="Before templatizing, each page is unique."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let’s say the header on the home page is unique, but the header on the Terms and Privacy (i.e. &lt;em&gt;interior&lt;/em&gt;) pages could be shared. And maybe the footer is the same on every page. Then we could make the header and footer into their own files and share them among multiple pages. Like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zq2rhOBC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--templatizing-after.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zq2rhOBC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--templatizing-after.png" alt="After templatizing, the header and footer can be shared where appropriate."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating these templates, changes to the footer only need to be made once and every page is updated to reflect the new changes.&lt;/p&gt;

&lt;p&gt;This is a super simplistic view to show the power that even small abstractions can add to the longevity of your site. What we’ll do here will be slightly different in practice.&lt;/p&gt;

&lt;p&gt;But how do we actually do this?&lt;/p&gt;

&lt;h2&gt;
  
  
  Static site generators are here to save the day!
&lt;/h2&gt;

&lt;p&gt;Unfortunately, the web isn’t built to work with templates. We can’t actually just add a &lt;code&gt;footer.html&lt;/code&gt; file and then tell every page to include it and have the browser work. In the end, the browser expects a &lt;em&gt;single&lt;/em&gt; HTML file. In other words, the browser actually &lt;em&gt;wants&lt;/em&gt; the non-templatized version of the two scenarios above.&lt;/p&gt;

&lt;p&gt;But that’s not how we want to work. It’s tedious and prone to errors. If you want the footer to look the same everywhere, it should &lt;em&gt;be&lt;/em&gt; the same everywhere. Otherwise, you risk making inadvertent changes on random pages. To help with this process we can use a tool called a &lt;a href="https://www.seancdavis.com/blog/wtf-is-ssg/"&gt;static site generator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jamstack.org/generators/"&gt;There are many to choose from&lt;/a&gt;, perhaps including some popular ones you may have heard of, such as &lt;a href="https://jekyllrb.com/"&gt;Jekyll&lt;/a&gt;, &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt;, &lt;a href="https://nextjs.org/"&gt;Next.js&lt;/a&gt;, or &lt;a href="https://gohugo.io/"&gt;Hugo&lt;/a&gt;. Here we’re going to use one called &lt;a href="https://www.11ty.dev/"&gt;Eleventy&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s so great about Eleventy?
&lt;/h2&gt;

&lt;p&gt;Eleventy isn’t as popular as some of its competition, but it is supreme in its approach, which is simplicity. It is modeled after Jekyll, which provides a super low barrier to getting started when compared with the rest of the field. But unlike Jekyll, it is written entirely in JavaScript, which makes it a great fit for folks getting started with building websites.&lt;/p&gt;

&lt;p&gt;Eleventy can also be super powerful. It takes more customization as your site grows in complexity, but it can grow with you. &lt;a href="https://www.seancdavis.com/"&gt;My site&lt;/a&gt; has several hundred pages and, at the time of writing this, is built entirely through Eleventy.&lt;/p&gt;

&lt;p&gt;Okay, &lt;em&gt;now&lt;/em&gt; are you convinced you should templatize those HTML files?&lt;/p&gt;

&lt;p&gt;Hooray! Me too.&lt;/p&gt;

&lt;p&gt;Let’s do it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: The Static Site
&lt;/h2&gt;

&lt;p&gt;Let’s work through this process together using a real-world example. We’re going to build a super simple version of &lt;a href="https://www.unmutedstories.com/"&gt;the Unmute website&lt;/a&gt;. (Unmute is a real thing — a side project I’m working on with a few nerdy friends.)&lt;/p&gt;

&lt;p&gt;We’ll have a unique &lt;a href="https://stackbit-jamstack-journey.netlify.app/"&gt;home&lt;/a&gt; &lt;a href="https://stackbit-jamstack-journey.netlify.app/"&gt;page&lt;/a&gt; along with two similar content pages, mimicking a &lt;a href="https://stackbit-jamstack-journey.netlify.app/terms/"&gt;Terms &amp;amp; Conditions page&lt;/a&gt; and a &lt;a href="https://stackbit-jamstack-journey.netlify.app/privacy/"&gt;Privacy Policy page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s say the output of the whatever process you went through to obtain the files for your site left you with &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/2c600cc/02-static-site/www"&gt;this mess&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;css/styles.css&lt;/code&gt; to hold all your styling for the site.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;js/bundle.js&lt;/code&gt; which handles the carousel at the bottom of the home page.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;images&lt;/code&gt; as a house for all visual assets.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;index.html&lt;/code&gt; to represent your home page.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;content-page.html&lt;/code&gt; to represent all other internal pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Gotcha!&lt;/strong&gt;&lt;br&gt;
Take note that we’re making a big assumption here. We’re assuming that you won’t need to mess with your &lt;code&gt;styles.css&lt;/code&gt; or &lt;code&gt;bundle.js&lt;/code&gt; file. They were bundled up nicely for you by the freelance dev and you won’t need to make changes.&lt;/p&gt;

&lt;p&gt;In the real world, it can be a tricky process to take big, bulky, obfuscated CSS and JS files and create a method for adding to them. And it gets even more complicated if you ever have to go back to the developer for changes &lt;em&gt;after&lt;/em&gt; you’ve customized one of these.&lt;/p&gt;

&lt;p&gt;As a result, we’re considering that process outside the scope of this guide. However, if this need arises, I’ve written a couple relatively simple guides on how to achieve this for both &lt;a href="https://www.seancdavis.com/blog/getting-started-with-postcss/"&gt;CSS&lt;/a&gt; and &lt;a href="https://www.seancdavis.com/blog/javascript-webpack-build-pipeline/"&gt;JavaScript&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Create a New Project
&lt;/h2&gt;

&lt;p&gt;Add the contents of the example static project to some directory on your machine. &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/archive/refs/tags/v1-draft.zip"&gt;Here’s a link to download the larger example&lt;/a&gt;. After doing that, you can find the appropriate files in the &lt;code&gt;02-static-site/www&lt;/code&gt; directory. Move these files into a new directory on your machine. Your folder’s contents &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/88e200d/03-templated-site"&gt;should look like this&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Setup Eleventy
&lt;/h2&gt;

&lt;p&gt;We’re going to assume you have a computer that is setup for web development. (If not, &lt;a href="https://www.seancdavis.com/blog/new-mac-dev-guide/"&gt;here’s a guide&lt;/a&gt; I wrote on setting up a new Mac for development.)&lt;/p&gt;

&lt;p&gt;Once you’re ready to go, open up your command line or terminal application, change into the project directory and install Eleventy:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# navigate to your new project
cd path/to/my/project

# setup project for Eleventy
npm init -y

# install eleventy
npm install -D @11ty/eleventy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: If you’re tracking your changes with&lt;/em&gt; &lt;a href="https://git-scm.com/"&gt;&lt;em&gt;Git&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, this is a great spot to initialize the repository (&lt;/em&gt;&lt;code&gt;git init&lt;/code&gt;&lt;em&gt;) and add&lt;/em&gt; &lt;code&gt;node_modules&lt;/code&gt; &lt;em&gt;to a&lt;/em&gt; &lt;code&gt;.gitignore&lt;/code&gt; &lt;em&gt;file. If you’re not working with Git, don’t worry about this right now.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I like to add a few shortcuts after this installation to make working with sites more consistent across my machine. Open your &lt;code&gt;package.json&lt;/code&gt; file and add the following to the &lt;code&gt;scripts&lt;/code&gt; section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eleventy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"clean"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rm -rf _site"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eleventy --serve --port 8000"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/1c80367/03-templated-site/package.json#L6-L10"&gt;Here’s what that file should look like at this point&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now we have a way to run an Eleventy development server. Run the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# start eleventy server
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You should now have a dev server running at localhost:8000. And you’ll notice you now have a new &lt;code&gt;_site&lt;/code&gt; directory in your project. Eleventy did this automatically for you.&lt;/p&gt;

&lt;p&gt;You can open your browser and visit localhost:8000 to see your site, and … &lt;em&gt;something doesn’t look right.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R42cla44--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--unmute-unstyled.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R42cla44--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--unmute-unstyled.png" alt="Where the heck are our styles??"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s because we didn’t tell Eleventy where our assets are. To do this, we must &lt;a href="https://www.11ty.dev/docs/config/"&gt;add an Eleventy config file&lt;/a&gt; at &lt;code&gt;.eleventy.js&lt;/code&gt;:&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="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="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;eleventyConfig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Copy static assets over to _site directory.&lt;/span&gt;
  &lt;span class="nx"&gt;eleventyConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addPassthroughCopy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;eleventyConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addPassthroughCopy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;images&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;eleventyConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addPassthroughCopy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Return configuration object.&lt;/span&gt;
  &lt;span class="k"&gt;return&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;Give the browser a refresh and everything should look good again!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jBmgszeK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--unmute-styled.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jBmgszeK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--unmute-styled.png" alt="Phew! That’s better."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Throughout this guide, when making changes, you may have to clear the cache on your browser. Most browsers have an option to reload while clearing the cache for that site.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: The Default Layout
&lt;/h2&gt;

&lt;p&gt;In Eleventy (and most static site generators), each page is wrapped in a &lt;em&gt;layout&lt;/em&gt;. A layout is just a fancy term for a template. We’re going to begin by creating a default layout. This will be code that every page uses. We do this because, as we’ll soon see, Eleventy supports nesting layouts within one another. So what we’re going to do here is define our base layout.&lt;/p&gt;

&lt;p&gt;In looking at &lt;code&gt;index.html&lt;/code&gt; and &lt;code&gt;content-page.html&lt;/code&gt;, the code that is consistent between the two is mostly contained within the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag, but also includes a few lines at the very bottom of the file. Here’s what it looks like:&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="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"apple-touch-icon"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"180x180"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/images/favicon/apple-touch-icon.png"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/png"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"32x32"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/images/favicon/favicon-32x32.png"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/png"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"16x16"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/images/favicon/favicon-16x16.png"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"manifest"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/images/favicon/site.webmanifest"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"mask-icon"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/images/favicon/safari-pinned-tab.svg"&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"#5bbad5"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"msapplication-TileColor"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"#da532c"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"theme-color"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"#ffffff"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Stackbit Demo: Unmute&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/css/styles.css"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
      &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;onInit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;undefined&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="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;onInit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&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;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-default"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="c"&gt;&amp;lt;!-- This was the unique code --&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/js/bundle.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put that code in a new file: &lt;code&gt;_includes/default.njk&lt;/code&gt;. And in the spot where the unique code existed, add the Nunjucks variable &lt;code&gt;content&lt;/code&gt;. (More on this in a moment.) Your resulting file should &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/7122194/03-templated-site/_includes/default.njk"&gt;look like this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Three items are important to note in this new template:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; We changed the file extension from &lt;code&gt;.html&lt;/code&gt; to &lt;code&gt;.njk&lt;/code&gt;. This means we’re using &lt;a href="https://mozilla.github.io/nunjucks/"&gt;Nunjucks&lt;/a&gt; as our templating language. Eleventy supports &lt;a href="https://www.11ty.dev/docs/languages/"&gt;a number of&lt;/a&gt; languages. Nunjucks is nice for staying with our theme of using JavaScript. And it’s also fairly minimalistic, which is nice for our example.&lt;/li&gt;
&lt;li&gt; We added a single Nunjucks variable, &lt;code&gt;content&lt;/code&gt; and passed a &lt;code&gt;safe&lt;/code&gt; filter to it. &lt;code&gt;content&lt;/code&gt; tells Nunjucks to render the content of the each page in that area. That means all of our page content will fall where you see &lt;code&gt;{{ content | safe }}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; The &lt;code&gt;_includes&lt;/code&gt; directory has some special characteristics that make it easy to … well, &lt;em&gt;include&lt;/em&gt; files. &lt;a href="https://www.11ty.dev/docs/config/#directory-for-includes"&gt;Read more here&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Nothing has changed if we refresh the browser because we haven’t wired these up yet. When we go to the home page, we’re still just looking at &lt;code&gt;index.html&lt;/code&gt;, which isn’t using our new layout yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Wrap the home page in the new layout
&lt;/h2&gt;

&lt;p&gt;Let’s adjust our home page to use the new layout.&lt;/p&gt;

&lt;p&gt;Begin by changing &lt;code&gt;index.html&lt;/code&gt; to &lt;code&gt;index.njk&lt;/code&gt;. This is going to help us in the future when we want to use Nunjucks variables or tags in the page.&lt;/p&gt;

&lt;p&gt;Now, remove all the code you extracted to create the layout and refresh your browser.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What the heck?&lt;/em&gt; You’re back to a page without styles. What happened?&lt;/p&gt;

&lt;p&gt;What happened is that you removed your references to the CSS and JS files, which were in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and near the bottom of the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, but you didn’t tell Eleventy to use a layout. So let’s change that. Add the following at the top of your &lt;code&gt;index.njk&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now refresh the browser and you should see your styles come back!&lt;/p&gt;

&lt;p&gt;This style code — three hyphens, then some code, then three more hyphens — is called &lt;a href="https://www.seancdavis.com/blog/wtf-is-frontmatter/"&gt;&lt;em&gt;frontmatter&lt;/em&gt;&lt;/a&gt;. It’s like &lt;em&gt;code before the code&lt;/em&gt;. It provides us a space to place meta information about that file that won’t ultimately be written to your browser screen.&lt;/p&gt;

&lt;p&gt;The last thing to note here is that you will want to either remove or change the comments in your code. Nunjucks comments look a little different than HTML comments (although they will ultimately still be treated as comments, so you can ignore this if you’d like).&lt;/p&gt;

&lt;p&gt;Any code between &lt;code&gt;&amp;lt;!--&lt;/code&gt; and &lt;code&gt;--&amp;gt;&lt;/code&gt; is an HTML comment. Either remove these or change them to &lt;code&gt;{#&lt;/code&gt; and &lt;code&gt;#}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the end, &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/b0b554e/03-templated-site/index.njk"&gt;this is what your new &lt;code&gt;index.njk&lt;/code&gt; file should look like&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Content Pages
&lt;/h2&gt;

&lt;p&gt;Now let’s add a couple plain content pages. Our developer delivered a generic content page to us called &lt;code&gt;content-page.html&lt;/code&gt;. We want to use that to create multiple pages. In this case, maybe those are Terms &amp;amp; Conditions and Privacy Policy pages.&lt;/p&gt;

&lt;p&gt;To do this we first want to make our generic content page a layout. To do that rename &lt;code&gt;content-page.html&lt;/code&gt; to &lt;code&gt;content-page.njk&lt;/code&gt; and move it into the &lt;code&gt;_includes&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Now, here’s a really weird and super cool thing about Eleventy — we can nest layouts in other layouts. What that means is that because the content page has code that we’ve already used in &lt;code&gt;_includes/default.njk&lt;/code&gt;, we can reuse that with the content page layout.&lt;/p&gt;

&lt;p&gt;To do this, remove the shared code from &lt;code&gt;_includes/content-page.njk&lt;/code&gt; and specify the layout in the frontmatter at the top of the file.&lt;/p&gt;

&lt;p&gt;Now you can create two new files, &lt;code&gt;terms.njk&lt;/code&gt; (or &lt;code&gt;terms.html&lt;/code&gt; — we aren’t doing anything special at this point) and &lt;code&gt;privacy.njk&lt;/code&gt;. Add some content (I used &lt;a href="https://app.termsfeed.com/"&gt;a generator&lt;/a&gt; for the content and you can use what I have) and tell Eleventy to use the “content-page” layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content-page"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can go to localhost:8000/terms and localhost:8000/privacy and you should see your nicely-formatted content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c31bZbxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--terms-page.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c31bZbxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.stackbit.com/images/210720--terms-page.png" alt="Terms page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are the links to these files at this stage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/b709edb/03-templated-site/_includes/content-page.njk"&gt;&lt;code&gt;_includes/content-page.njk&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/b709edb/03-templated-site/terms.njk"&gt;&lt;code&gt;terms.njk&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/b709edb/03-templated-site/privacy.njk"&gt;&lt;code&gt;privacy.njk&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 7: Extracting Shared Code
&lt;/h2&gt;

&lt;p&gt;Now you’re in good shape and have a pattern to create new pages with a nice layout. Any new file you create with the “content-page” layout will now have a header and footer wrapping your content.&lt;/p&gt;

&lt;p&gt;But, we still have an opportunity for some improvement. While we are using a layout to create multiple pages, which means we’re sharing code, we do still have some duplicated code. Now the home page (&lt;code&gt;index.njk&lt;/code&gt;) and the content page layout (&lt;code&gt;_includes/content-page.njk&lt;/code&gt;) have separate footers. Even though they look the same, you’d have to edit the content in both if you wanted to make a global change.&lt;/p&gt;

&lt;p&gt;Let’s make that easier. Pull the footer content into its own file in the &lt;code&gt;_includes&lt;/code&gt; directory, &lt;code&gt;_includes/footer.njk&lt;/code&gt; (&lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/f1af38f/03-templated-site/_includes/footer.njk"&gt;see here&lt;/a&gt;). Then remove that shared code from the home page and content page layout and replace it with &lt;a href="https://mozilla.github.io/nunjucks/templating.html#include"&gt;the &lt;code&gt;include&lt;/code&gt; Nunjucks tag&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{% include "footer.njk" %}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(See the new &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/f1af38f/03-templated-site/index.njk"&gt;&lt;code&gt;index.njk&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/f1af38f/03-templated-site/_includes/content-page.njk"&gt;&lt;code&gt;_includes/content-page.njk&lt;/code&gt;&lt;/a&gt; files.)&lt;/p&gt;

&lt;p&gt;Now you can make the change once and see it work everywhere. For example, you could &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/commit/bf4025d"&gt;add links to the terms and privacy pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: You could have chosen to include the footer directly in the default layout, or even reference in in the default layout. This is entirely up to you and your project. In this case, I’m accounting for some future template that won’t want the footer. But if we’re sure every page wants the footer, maybe it makes sense to put it in the default layout.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Opportunities
&lt;/h2&gt;

&lt;p&gt;As your site grows, you’ll find other opportunities for improvement and abstraction (&lt;em&gt;abstraction&lt;/em&gt; being the process of cleaning up code to be shared).&lt;/p&gt;

&lt;h3&gt;
  
  
  Shared Images
&lt;/h3&gt;

&lt;p&gt;For example, many of the shapes you see on the pages are SVG elements. They are images, but represented with HTML code. And many of them are used more than once.&lt;/p&gt;

&lt;p&gt;You could remove the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; elements and turn them into their own file in the &lt;code&gt;_includes&lt;/code&gt; directory. (You could even put them in their own subdirectory so they are grouped together.) Then you can reference them with a Nunjucks tag.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unique Titles
&lt;/h3&gt;

&lt;p&gt;You may also run into the opposite issue at some point, where you’ll have code or content in a shared space, but you want it to be unique to some particular template. For example, you’ll want the title of the page (contained in the &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; attribute) to be unique to each page. But that code is nestled up in the default layout.&lt;/p&gt;

&lt;p&gt;This is where Nunjucks variables and page frontmatter comes into play. Take the terms page, for example. You could add a &lt;code&gt;title&lt;/code&gt; attribute in its frontmatter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content-page"&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Terms&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Conditions"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in the &lt;code&gt;_includes/default.njk&lt;/code&gt; layout, you can use the &lt;code&gt;title&lt;/code&gt; variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;title&amp;gt;{{ title }}&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You could make the same change to the &lt;code&gt;_includes/content-page.njk&lt;/code&gt; body so that you don’t have to write the &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; on every page. Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;{{ title }}&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The world is your oyster when it comes to finding these efficiencies. It’s all about how you want to work and how you want the framework (Eleventy) to work for you.&lt;/p&gt;

&lt;p&gt;I bucketed a handful of these changes together and did them all at once. &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/commit/6e9cb47"&gt;Here are the changes I made&lt;/a&gt; and &lt;a href="https://github.com/seancdavis/stackbit-jamstack-journey/tree/6e9cb47/03-templated-site"&gt;the files in the project at this point&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Phew! Take a break, give yourself a pat on the back. This process can be a harrowing one, especially the first time around. If you’ve made it through, you deserve a break and some ice cream.&lt;/p&gt;

&lt;p&gt;To quickly recap. What we started with was a jumbled mess of HTML files, handed to you by some developer. We took those files and turned them into layouts (or templates) that we could use to quickly create new pages with the same design.&lt;/p&gt;

&lt;p&gt;Where do we go from here?&lt;/p&gt;

&lt;p&gt;I’m glad you let me ask that question on your behalf, because we have a great next step! Instead of using &lt;code&gt;.html&lt;/code&gt; or &lt;code&gt;.njk&lt;/code&gt; files for our content, you can double-down on frontmatter and markdown to create a truly powerful editing experience that gets all the code out of your way and keeps you focused on only the content.&lt;/p&gt;

&lt;p&gt;And, lucky for you, &lt;a href="https://www.stackbit.com/blog/jamstack-journey-separate-content/"&gt;we have a guide&lt;/a&gt; to keep this thing going and to walk you through that process.&lt;/p&gt;

&lt;p&gt;But first, go get that ice cream.&lt;/p&gt;

</description>
      <category>jamstack</category>
      <category>html</category>
      <category>eleventy</category>
      <category>ssg</category>
    </item>
  </channel>
</rss>
