<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Jadey Ryan</title>
<link>https://jadeyryan.com/blog.html</link>
<atom:link href="https://jadeyryan.com/blog.xml" rel="self" type="application/rss+xml"/>
<description>R code, environmental data science, and cats.</description>
<image>
<url>https://jadeyryan.com/assets/img/data-whiskeRs-thumbnail.webp</url>
<title>Jadey Ryan</title>
<link>https://jadeyryan.com/blog.html</link>
</image>
<generator>quarto-1.8.25</generator>
<lastBuildDate>Thu, 03 Apr 2025 00:00:00 GMT</lastBuildDate>
<item>
  <title>Create your own custom {ggplot2} theme</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2025-04-03_rru-ggplot2/</link>
  <description><![CDATA[ 




<p><strong>Read the post on the <a href="https://rfortherestofus.com/2025/04/ggplot2-theme/">R for the Rest of Us blog</a>!</strong></p>
<p><a href="https://rfortherestofus.com/2025/04/ggplot2-theme/" data-fig-alt="Screenshot of the blog post section 'Wrap it in a function' with some of the example code showing."><img src="https://jadeyryan.com/blog/2025-04-03_rru-ggplot2/screenshot.webp" class="img-fluid"></a></p>
<section id="accompanying-video-tutorial" class="level3">
<h3 class="anchored" data-anchor-id="accompanying-video-tutorial">Accompanying video tutorial</h3>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/I9DEq4zDCb4" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>


</section>

 ]]></description>
  <category>ggplot2</category>
  <category>Data visualization</category>
  <guid>https://jadeyryan.com/blog/2025-04-03_rru-ggplot2/</guid>
  <pubDate>Thu, 03 Apr 2025 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2025-04-03_rru-ggplot2/featured.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>Automate file management in R with the {fs} package</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2025-01-09_rru-fs/</link>
  <description><![CDATA[ 




<p><strong> Read the post on the <a href="https://rfortherestofus.com/2025/01/fs-file-management/">R for the Rest of Us blog</a>!</strong></p>
<p><a href="https://rfortherestofus.com/2025/01/fs-file-management/" data-fig-alt="Screenshot of the 'Use functions to easily repeat this process' section of the blog post."><img src="https://jadeyryan.com/blog/2025-01-09_rru-fs/screenshot.webp" class="img-fluid"></a></p>
<section id="accompanying-video-tutorial" class="level3">
<h3 class="anchored" data-anchor-id="accompanying-video-tutorial">Accompanying video tutorial</h3>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/aeIuenml0Ic" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>


</section>

 ]]></description>
  <category>fs</category>
  <category>File management</category>
  <guid>https://jadeyryan.com/blog/2025-01-09_rru-fs/</guid>
  <pubDate>Thu, 09 Jan 2025 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2025-01-09_rru-fs/featured.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>Automating Quarto reports with parameters</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2024-08-20_posit-quarto-params/</link>
  <description><![CDATA[ 




<p><strong>Read the post on the <a href="https://posit.co/blog/parameterized-quarto/">Posit blog</a>!</strong></p>
<p><a href="https://posit.co/blog/parameterized-quarto/"><img src="https://jadeyryan.com/blog/2024-08-20_posit-quarto-params/parameters-quarto.webp" class="img-fluid"></a></p>



 ]]></description>
  <category>Quarto</category>
  <category>Parameterized reports</category>
  <guid>https://jadeyryan.com/blog/2024-08-20_posit-quarto-params/</guid>
  <pubDate>Tue, 20 Aug 2024 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2024-08-20_posit-quarto-params/featured.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>A beginner’s guide to building a simple website with Quarto &amp; Netlify</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/</link>
  <description><![CDATA[ 




<p>Are you eager to build a website but don’t have any web development experience or coding knowledge? Fear not! In this guide, I’ll walk you through the process of creating a simple website using the Quarto visual editor and deploying it seamlessly with Netlify’s drag and drop tool.</p>
<section id="why-quarto-netlify" class="level1 unnumbered">
<h1 class="unnumbered">Why Quarto &amp; Netlify?</h1>
<p>Why use Quarto &amp; Netlify over other website building options like WordPress? While WordPress software is open-source and free, you have to pay for hosting to make your website available online. Additionally, you may need to purchase premium plugins or themes for additional functionality or style.</p>
<p>Instead, Quarto offers beautiful, free Bootstrap themes and plenty of simple website functionality like blog listings, searches, etc. When you get more comfortable with your website, you’ll have more control over the design and layout of your site without being overwhelmed by excessive options of WordPress themes or plugins. Quarto websites can be hosted online with Netlify’s completely <a href="https://www.netlify.com/pricing/">free plan</a>.</p>
<p>Check out some example Quarto websites at <a href="https://qmdclub.com/">qmdclub.com</a> (this site is one of the examples 😄).</p>
</section>
<section id="install-your-tools" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Install your tools</h1>
<p>First things first, let’s get your tools set up: RStudio &amp; Quarto. <a href="https://posit.co/products/open-source/rstudio/"><strong>RStudio</strong></a> is the desktop application that we’ll work in, while <a href="https://quarto.org/docs/get-started/"><strong>Quarto</strong></a> is what will build the website. We’ll use the Quarto visual editor to write and format the content for our website pages. While there’s no installation required for Netlify, you will need to <a href="https://app.netlify.com/signup"><strong>create a free account</strong></a>.</p>
<p><a href="https://posit.co/download/rstudio-desktop/"><strong>Download and install R and RStudio Desktop from Posit</strong></a><strong>.</strong> Note that <a href="https://www.r-project.org/">R</a> and <a href="https://docs.posit.co/ide/user/">RStudio</a> are different things. R is a programming language often used for statistics, data analyses, and data visualizations. RStudio is the integrated development environment (IDE), or desktop application, that has nice point-and-click features. Although we won’t directly use R, we still need to download it so we can use RStudio.</p>
<p>Quarto will automatically be installed with RStudio. The version of Quarto installed with RStudio may not be the latest version, so you can <em>optionally</em> <a href="https://quarto.org/docs/get-started/">install Quarto separately</a>. Quarto is an open-source publishing system, developed by the same company (<a href="https://posit.co/">Posit</a>) that develops RStudio so they integrate very nicely.</p>
<p>RStudio and Quarto are powerful tools that can create a lot more than just websites. However, in this tutorial, I assume you’ve never used either before. I’ll introduce only the components necessary to get you started with a simple website.</p>
</section>
<section id="create-a-quarto-website" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Create a Quarto website</h1>
<p>Open RStudio, click the <code>Create a project</code> button to open the <strong>New Project Wizard</strong>, and then select <code>New Directory</code>.</p>
<p><a href="img/create-project.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/create-project.webp" class="img-fluid" alt="RStudio with box around 'New project' button with arrow to the 'New Directory' button in the 'Create Project' step of the 'New Project Wizard'."></a></p>
<p>Select <code>Quarto Website</code> as the project type.</p>
<p><a href="img/project-type.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/project-type.webp" class="img-fluid" alt="RStudio with box around the 'Quarto Website' in the 'Project Type' step of the 'New Project Wizard'."></a></p>
<p>A “directory” is basically the same thing as a computer folder. Choose what you want to name your folder (probably the same as your website name)<sup>1</sup>, browse to where you want this folder to live, check the <code>Use visual markdown editor</code> button, and then click <code>Create Project</code>.</p>
<p><a href="img/create-website.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/create-website.webp" class="img-fluid" alt="RStudio with box around 'Directory name', 'Browse', 'Use visual markdown editor', and 'Create Project' in the 'Create Quarto Website' step of the 'New Project Wizard'."></a></p>
<p>We should now be in a new project that has <code>index.qmd</code> open in <a href="https://quarto.org/docs/visual-editor/index.html">visual editor mode</a>, and some new things in our <code>Files pane</code>. We’ll get to what these files are in the next Understand the files section. But first, let’s take a look at what the default website looks like. Open the <code>Build pane</code>, and then click the <code>Render Website</code> button.</p>
<p><a href="img/rstudio.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-4"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/rstudio.webp" class="img-fluid" alt="RStudio with boxes around the 'Visual' toggle and formatting toolbar, the 'Build' pane showing the 'Render Website' button, and the 'Files' pane showing all the default project files."></a></p>
<p>Once the website renders, the bottom right pane will switch from <code>Files</code> to <code>Viewer</code> and display the website preview. Click the <code>Show in new window</code> button to open this preview in your default browser.</p>
<p><a href="img/render.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-5"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/render.webp" class="img-fluid" alt="RStudio with boxes around the 'Render Website' button with arrow pointing to the 'Viewer' pane that shows the preview of the website."></a></p>
<section id="what-just-happened" class="level2" data-number="2.1">
<h2 data-number="2.1" class="anchored" data-anchor-id="what-just-happened"><span class="header-section-number">2.1</span> What just happened?</h2>
<p>When we clicked <code>Render Website</code>, Quarto turns all of the <code>.qmd</code> files and styling sheets into HTML (HyperText Markup Language) source files that serve as the website. The website was rendered into the new folder <code>_site</code>. You can even click on any of the <code>.html</code> files and view it in your web browser to see how it looks. Every time we render the website, this <code>_site</code> folder gets updated.</p>
</section>
</section>
<section id="understand-the-files" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Understand the files</h1>
<p>Cool, now you know RStudio and Quarto are correctly installed and you can render a simple website! Before we start customizing your website, let’s take a look at what files came pre-loaded with this default website.</p>
<p>Our <code>Files pane</code> should include:</p>
<pre><code>├── _quarto.yml         # Website configuration file
├── about.qmd           # About page
├── index.qmd           # Landing page
├── my-website.Rproj    # RStudio project config file
└── styles.css          # CSS style sheet</code></pre>
<ul>
<li><p><code>_quarto.yml</code> is a special file that configures the website options like the title, which <code>.qmd</code> files to include, navigation, styling, etc. <em>Do not rename this file</em>. Quarto needs this file to render your website.</p></li>
<li><p><code>.qmd</code> files are Quarto documents where you’ll write your webpage content.</p>
<ul>
<li><p><code>index.qmd</code> is the landing/home page of the website<em>. Do not rename this file.</em> Netlify needs this file to publish your website.</p></li>
<li><p><code>about.qmd</code> is another page on the website. It can be renamed or removed.</p></li>
</ul></li>
<li><p>Ignore the <code>.Rproj</code> file, which is a RStudio project configuration file.</p></li>
<li><p><code>styles.css</code> is a where you can customize the style of specific elements of your website using <a href="https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics">CSS</a>. Ignore this until you’re ready for more advanced customization. We’ll get to styling our simple website in the Style your website section.</p></li>
</ul>
<section id="what-are-quarto-documents" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="what-are-quarto-documents"><span class="header-section-number">3.1</span> What are Quarto documents?</h2>
<p>Each <code>.qmd</code> has a <a href="https://en.wikipedia.org/wiki/YAML">YAML</a> (YAML Ain’t Markup Language) header for document-specific options and Markdown content. Quarto documents are authored using Markdown, which is a plain text format designed to be easy to write and easy to read. We’ll use the visual editor in this tutorial, but you’ll likely eventually need Markdown if you want more customization options. Reference the text formatting markdown syntax and output in this <a href="https://quarto.org/docs/authoring/markdown-basics.html">Markdown Basics article</a>. You can also toggle between <code>Source</code> and <code>Visual</code> to see the underlying Markdown as you’re writing your Quarto documents.</p>
</section>
</section>
<section id="edit-the-home-page" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Edit the home page</h1>
<p>Open <code>index.qmd</code> and notice the box at the top of the document that has <code>title: "my-website"</code> sandwiched between two sets of three dashes <code>---</code>. This is called the <a href="https://quarto.org/docs/get-started/hello/rstudio.html#yaml-header">YAML header</a>, which contains the metadata for the document. The only metadata we currently have is the webpage title. Each YAML entry consists of <code>key: value</code> pairs. The colon and space are required. Be careful with indentation, it can be quite fussy.</p>
<p>Write all content for the webpage below this YAML. Use the formatting toolbar at the top of the document to format text, create headings, or insert images, lists, and tables.</p>
<p>When working on a single page, I like to check the <code>Render on Save</code> option so that the website preview updates every time I save the <code>.qmd</code> file. Alternatively, click the <code>Render</code> button, which saves the file and updates the preview.</p>
<section id="my-turn" class="level2" data-number="4.1">
<h2 data-number="4.1" class="anchored" data-anchor-id="my-turn"><span class="header-section-number">4.1</span> My turn</h2>
<p><a href="img/homepage.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-6"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/homepage.webp" class="img-fluid" alt="RStudio with orange boxes around the 'Render on Save' button, 'YAML' header. Green boxes around the document content and preview.."></a></p>
</section>
<section id="your-turn" class="level2" data-number="4.2">
<h2 data-number="4.2" class="anchored" data-anchor-id="your-turn"><span class="header-section-number">4.2</span> Your turn</h2>
<ol type="1">
<li>Open <code>index.qmd</code>.</li>
<li>Check <code>Render on Save</code>.</li>
<li>Change the webpage title.</li>
<li>Save the file (<code>Cmd</code>/<code>Ctrl</code> + <code>S</code>).</li>
<li>Delete the example text and write some of your own.</li>
<li>Save again.</li>
</ol>
</section>
</section>
<section id="edit-the-about-page" class="level1" data-number="5">
<h1 data-number="5"><span class="header-section-number">5</span> Edit the about page</h1>
<p>Quarto makes it easy to create a simple, professional about page for a person, organization, or pets 😏. Add the <code>about:</code> option in the YAML to use one of the five special templates previewed below (<a href="https://quarto.org/docs/websites/website-about.html#templates">examples from Quarto docs</a>).</p>
<div class="tabset-margin-container"></div><div class="panel-tabset">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-1-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-1" aria-controls="tabset-1-1" aria-selected="true" href="">jolla</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-2" aria-controls="tabset-1-2" aria-selected="false" href="">trestles</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-3" aria-controls="tabset-1-3" aria-selected="false" href="">solana</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-4" aria-controls="tabset-1-4" aria-selected="false" href="">marquee</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-5-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-5" aria-controls="tabset-1-5" aria-selected="false" href="">broadside</a></li></ul>
<div class="tab-content">
<div id="tabset-1-1" class="tab-pane active" aria-labelledby="tabset-1-1-tab">
<p><a href="https://quarto.org/docs/websites/images/about-jolla.png" class="lightbox" data-gallery="quarto-lightbox-gallery-7"><img src="https://quarto.org/docs/websites/images/about-jolla.png" class="border img-fluid" alt="Screenshot of About page with jolla template. Photo is a centered circle above a heading with the author's name. There is a centered paragraph below the header, a separator line, and then buttons for twitter and github centered at the bottom."></a></p>
</div>
<div id="tabset-1-2" class="tab-pane" aria-labelledby="tabset-1-2-tab">
<p><a href="https://quarto.org/docs/websites/images/about-trestles.png" class="lightbox" data-gallery="quarto-lightbox-gallery-8"><img src="https://quarto.org/docs/websites/images/about-trestles.png" class="border img-fluid" alt="Screenshot of About page with trestles template. On the left-hand side there is a rectangular photo above the author's name, and two buttons (one for twitter, and one for github below). On the right hand side there is a paragraph of body text followed by headered sections for Education and Experience."></a></p>
</div>
<div id="tabset-1-3" class="tab-pane" aria-labelledby="tabset-1-3-tab">
<p><a href="https://quarto.org/docs/websites/images/about-solana.png" class="lightbox" data-gallery="quarto-lightbox-gallery-9"><img src="https://quarto.org/docs/websites/images/about-solana.png" class="border img-fluid" alt="Screenshot of About page with solana template. The left-hand side has the name as a main header with buttons for twitter and github below it. Below the buttons there is a paragraph of body text, followed by headered sections for Education and Experience. In the upper right-hand column there is a rectangular image."></a></p>
</div>
<div id="tabset-1-4" class="tab-pane" aria-labelledby="tabset-1-4-tab">
<p><a href="https://quarto.org/docs/websites/images/about-marquee.png" class="lightbox" data-gallery="quarto-lightbox-gallery-10"><img src="https://quarto.org/docs/websites/images/about-marquee.png" class="border img-fluid" alt="Screenshot of About page with marquee template. A large square image is at the top. Beneath that the author's name is a header, and there is a paragraph of body text, followed by headered sections for Education and Experience. Centered at the bottom of the page are links to Twitter and GitHub with their respective icons next to them."></a></p>
</div>
<div id="tabset-1-5" class="tab-pane" aria-labelledby="tabset-1-5-tab">
<p><a href="https://quarto.org/docs/websites/images/about-broadside.png" class="lightbox" data-gallery="quarto-lightbox-gallery-11"><img src="https://quarto.org/docs/websites/images/about-broadside.png" class="border img-fluid" alt="Screenshot of About page with broadside template. The left side is a rectangular image. On the right-hand side the author's name is a header, and there is a paragraph of body text, followed by headered sections for Education and Experience. Centered at the bottom of the page are links to Twitter and GitHub with their respective icons next to them."></a></p>
</div>
</div>
</div>
<section id="my-turn-1" class="level2" data-number="5.1">
<h2 data-number="5.1" class="anchored" data-anchor-id="my-turn-1"><span class="header-section-number">5.1</span> My turn</h2>
<p>I like the <code>jolla</code> template. In my <code>my-website</code> project folder, I added a new folder called <code>images</code> for my pictures. This is optional - just be sure to match the file path.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb2-1"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">---</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">title</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mai, Tai, and Skye"</span></span>
<span id="cb2-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">image</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> images/couch-kits.JPG</span></span>
<span id="cb2-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">about</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb2-5"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">template</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> jolla</span></span>
<span id="cb2-6"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">links</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb2-7"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">icon</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> instagram</span></span>
<span id="cb2-8"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> Instagram</span></span>
<span id="cb2-9"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">href</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> https://www.instagram.com/piggies.and.kits</span></span>
<span id="cb2-10"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">---</span></span></code></pre></div></div>
<p><a href="img/about.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-12"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/about.webp" class="img-fluid" alt="RStudio with orange boxes around the YAML header with the 'about' template and green boxes around the page content."></a></p>
</section>
<section id="your-turn-1" class="level2" data-number="5.2">
<h2 data-number="5.2" class="anchored" data-anchor-id="your-turn-1"><span class="header-section-number">5.2</span> Your turn</h2>
<ol type="1">
<li>Open <code>about.qmd</code>.</li>
<li>Check <code>Render on Save</code>, and save after each below step to update the preview.</li>
<li>Update the title to your name or organization.</li>
<li>Add the <code>about</code> option to the YAML. Check out the previews of the <a href="https://quarto.org/docs/websites/website-about.html#templates">templates</a> and choose which one you like best.</li>
<li>Add a photo to your project folder or to a subfolder, and then add the file path to that photo to the <code>image:</code> option.</li>
<li>Add any social media or other websites you like to the <code>links:</code> option. Optionally, you can use <a href="https://icons.getbootstrap.com/">Bootstrap icons</a>.</li>
</ol>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Tip
</div>
</div>
<div class="callout-body-container callout-body">
<p>If you want to use the special about template as your home page, you can add the <code>about</code> YAML option to <code>index.qmd</code>. In fact, the <code>about:</code> option can be used for any <code>.qmd</code> document for your website!</p>
</div>
</div>
</section>
</section>
<section id="add-a-new-page" class="level1" data-number="6">
<h1 data-number="6"><span class="header-section-number">6</span> Add a new page</h1>
<p>Now that you’ve updated the two pages that came with the default Quarto website project, it’s time to add another page!</p>
<p>Click the <code>New file</code> button and select <code>Quarto document</code>. This will open a dialog box to name your file. After clicking <code>OK</code>, a blank <code>.qmd</code> file with your chosen name will open.</p>
<section id="my-turn-2" class="level2" data-number="6.1">
<h2 data-number="6.1" class="anchored" data-anchor-id="my-turn-2"><span class="header-section-number">6.1</span> My turn</h2>
<p>I named my new page <code>birthdays</code> because I’m adding pictures from Mai’s, Tai’s, and Skye’s birthday party 🥳.</p>
<p><a href="img/new-page.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-13"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/new-page.webp" class="img-fluid" alt="RStudio with boxes around the 'New File' button, 'Quarto Document' button, and the dialog box to name the new '.qmd' file."></a></p>
<p>This new page opened completely blank. From the <code>Insert</code> menu of the editor toolbar, I selected <code>YAML Block</code>, to which I added the page title.</p>
<p><a href="img/insert-yaml.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-14"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/insert-yaml.webp" class="img-fluid" alt="RStudio with boxes around the 'Insert' button of the editor toolbar, the 'YAML block' option, and the YAML header in the 'birthdays.qmd'."></a></p>
<p>I added headings and images for our family picture and each of our three cats. For more advanced figure layouts, see this <a href="https://quarto.org/docs/authoring/figures.html">Quarto article</a>.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-2-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-2-1" aria-controls="tabset-2-1" aria-selected="true" href="">Visual</a></li><li class="nav-item"><a class="nav-link" id="tabset-2-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-2-2" aria-controls="tabset-2-2" aria-selected="false" href="">Source</a></li></ul>
<div class="tab-content">
<div id="tabset-2-1" class="tab-pane active" aria-labelledby="tabset-2-1-tab">
<p><a href="img/visual.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-15"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/visual.webp" class="img-fluid" alt="RStudio with the 'birthdays.qmd' file in Visual editor mode side by side with the website preview of the MTS Birthday page."></a></p>
</div>
<div id="tabset-2-2" class="tab-pane" aria-labelledby="tabset-2-2-tab">
<p><a href="img/source.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-16"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/source.webp" class="img-fluid" alt="RStudio with the 'birthdays.qmd' file in editor mode side by side with the website preview of the MTS Birthday page."></a></p>
</div>
</div>
</div>
</section>
<section id="your-turn-2" class="level2" data-number="6.2">
<h2 data-number="6.2" class="anchored" data-anchor-id="your-turn-2"><span class="header-section-number">6.2</span> Your turn</h2>
<ol type="1">
<li>Create a new Quarto document.</li>
<li>Add the <code>YAML Block</code>.</li>
<li>Add a page title.</li>
<li>Add some content to your page.</li>
<li>Render the page.</li>
<li>Build and look at the website.</li>
</ol>
<p>Notice that your new page isn’t included on the website! Fix this by adding it to <code>_quarto.yml</code>.</p>
</section>
</section>
<section id="update-_quarto.yml" class="level1" data-number="7">
<h1 data-number="7"><span class="header-section-number">7</span> Update <code>_quarto.yml</code></h1>
<p>To make sure the new page is included on your website, you must add it to your <code>_quarto.yml</code> file.</p>
<p>This is also the place to change how the website title and page links are displayed in the navigation bar.</p>
<ul>
<li>Under <code>navbar:</code>
<ul>
<li><code>left:</code> means these links will appear on the left side of the navbar. You can also use the <code>right:</code> option to show certain links on the right side.
<ul>
<li><code>href:</code> must be the filename of the <code>.qmd</code></li>
<li><code>text:</code> is the link to that page.</li>
</ul></li>
</ul></li>
</ul>
<section id="my-turn-3" class="level2" data-number="7.1">
<h2 data-number="7.1" class="anchored" data-anchor-id="my-turn-3"><span class="header-section-number">7.1</span> My turn</h2>
<p>In <code>_quarto.yml</code>, I changed the website title, changed the text for the link to the about page, and added the birthdays page to the navigation bar.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-3-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-3-1" aria-controls="tabset-3-1" aria-selected="true" href="">Updated</a></li><li class="nav-item"><a class="nav-link" id="tabset-3-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-3-2" aria-controls="tabset-3-2" aria-selected="false" href="">Default</a></li></ul>
<div class="tab-content">
<div id="tabset-3-1" class="tab-pane active" aria-labelledby="tabset-3-1-tab">
<p><a href="img/updated-yml.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-17"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/updated-yml.webp" class="img-fluid" alt="RStudio with the updated '_quarto.yml' side by side with the website preview."></a></p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">website</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb3-2"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">title</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MTS -- The Best Kits!"</span></span>
<span id="cb3-3"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">navbar</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb3-4"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb3-5"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">href</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> index.qmd</span></span>
<span id="cb3-6"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">        </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> Home</span></span>
<span id="cb3-7"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">href</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> about.qmd</span></span>
<span id="cb3-8"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">        </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> About</span></span>
<span id="cb3-9"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">href</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> birthdays.qmd</span></span>
<span id="cb3-10"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">        </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> Birthday</span></span></code></pre></div></div>
</div>
<div id="tabset-3-2" class="tab-pane" aria-labelledby="tabset-3-2-tab">
<p><a href="img/default-yml.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-18"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/default-yml.webp" class="img-fluid" alt="RStudio with the default '_quarto.yml' side by side with the website preview."></a></p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">website</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb4-2"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">title</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my-website"</span></span>
<span id="cb4-3"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">navbar</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb4-4"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb4-5"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">href</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> index.qmd</span></span>
<span id="cb4-6"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">        </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> Home</span></span>
<span id="cb4-7"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> about.qmd</span></span></code></pre></div></div>
</div>
</div>
</div>
</section>
<section id="your-turn-3" class="level2" data-number="7.2">
<h2 data-number="7.2" class="anchored" data-anchor-id="your-turn-3"><span class="header-section-number">7.2</span> Your turn</h2>
<ol type="1">
<li>Open <code>_quarto.yml</code>.</li>
<li>Change the website title.</li>
<li>Optionally, update the text for the link to the about page.</li>
<li>Add a new entry for the new page you added.</li>
<li>Render.</li>
</ol>
</section>
</section>
<section id="style-your-website" class="level1" data-number="8">
<h1 data-number="8"><span class="header-section-number">8</span> Style your website</h1>
<p>Now that you’ve got a few pages set up, it’s time to customize the look and feel of your site! Quarto websites can use any of the 25 themes from the <a href="https://bootswatch.com/">Bootswatch project</a>.</p>
<p>In <code>_quarto.yml</code>, under the <code>html:</code> <code>theme:</code> option, replace the default <code>cosmos</code> with your theme of choice. Make sure the theme value is all lowercase.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb5-2"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb5-3"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> minty</span></span>
<span id="cb5-4"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">css</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> styles.css</span></span></code></pre></div></div>
<p>If you’re ready to do more advanced customization, you can open and edit <code>styles.css</code>. See the <a href="https://quarto.org/docs/output-formats/html-themes.html">Quarto docs on theming</a>.</p>
<section id="my-turn-4" class="level2" data-number="8.1">
<h2 data-number="8.1" class="anchored" data-anchor-id="my-turn-4"><span class="header-section-number">8.1</span> My turn</h2>
<p>I previewed the <a href="https://bootswatch.com/minty/">minty</a>, <a href="https://bootswatch.com/quartz/">quartz</a>, and <a href="https://bootswatch.com/solar/">solar</a> themes.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-4-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-1" aria-controls="tabset-4-1" aria-selected="true" href="">minty</a></li><li class="nav-item"><a class="nav-link" id="tabset-4-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-2" aria-controls="tabset-4-2" aria-selected="false" href="">quartz</a></li><li class="nav-item"><a class="nav-link" id="tabset-4-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-3" aria-controls="tabset-4-3" aria-selected="false" href="">solar</a></li></ul>
<div class="tab-content">
<div id="tabset-4-1" class="tab-pane active" aria-labelledby="tabset-4-1-tab">
<p><a href="img/minty.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-19"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/minty.webp" class="img-fluid" alt="RStudio with the theme set to 'minty' in the '_quarto.yml' side by side with the website preview."></a></p>
</div>
<div id="tabset-4-2" class="tab-pane" aria-labelledby="tabset-4-2-tab">
<p><a href="img/quartz.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-20"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/quartz.webp" class="img-fluid" alt="RStudio with the theme set to 'quartz' in the '_quarto.yml' side by side with the website preview."></a></p>
</div>
<div id="tabset-4-3" class="tab-pane" aria-labelledby="tabset-4-3-tab">
<p><a href="img/solar.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-21"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/solar.webp" class="img-fluid" alt="RStudio with the theme set to 'solar' in the '_quarto.yml' side by side with the website preview."></a></p>
</div>
</div>
</div>
</section>
<section id="your-turn-4" class="level2" data-number="8.2">
<h2 data-number="8.2" class="anchored" data-anchor-id="your-turn-4"><span class="header-section-number">8.2</span> Your turn</h2>
<ol type="1">
<li>Go to <a href="https://bootswatch.com/">Bootswatch project</a> and see which themes you like.</li>
<li>Open <code>_quarto.yml</code>, and try them out. Make sure to re-render to update the preview.</li>
</ol>
</section>
</section>
<section id="publish-to-netlify" class="level1" data-number="9">
<h1 data-number="9"><span class="header-section-number">9</span> Publish to Netlify</h1>
<p>Once you’re happy with your website, it’s time to publish it so anyone can view it on the live web! We’re going to use Netlify because it’s <em>free</em> and very simple to use with their <a href="https://docs.netlify.com/site-deploys/create-deploys/#drag-and-drop">drag and drop deployment tool</a>.</p>
<p>Remember back when we first rendered the website, Quarto created the new <code>_site</code> folder? This is what we’ll drop into the Netlify deployment tool. <code>_site</code> contains all the HTML files, style sheets, images, and other resources that make up the website. You must drop the entire <code>_site</code> folder into the Netlify tool. Dropping the contents of the folder will error and Netlify will tell you “Please drop a folder containing an index.html file.”</p>
<p><a href="img/site-folder.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-22"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/site-folder.webp" class="img-fluid" alt="RStudio 'Files' pane with a box around the '_site' folder and an arrow pointing to another screenshot of the 'Files' pane with all the files in '_site'."></a></p>
<p>After it uploads, we’ll look at the live website and change the site name.</p>
<section id="my-turn-5" class="level2" data-number="9.1">
<h2 data-number="9.1" class="anchored" data-anchor-id="my-turn-5"><span class="header-section-number">9.1</span> My turn</h2>
<p>I already have a Netlify account. So I logged in and opened the <code>Sites</code> tab. Then I dragged &amp; dropped my <code>_site</code> folder into the <code>... or deploy manually</code> box.</p>
<p><a href="img/deploy-netlify.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-23"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/deploy-netlify.webp" class="img-fluid" alt="Netlify with boxes around the 'Sites' button and the '...or deploy manually' box for the Drag &amp; Drop Deployment tool."></a></p>
<p>After the <code>_site</code> folder uploaded, a <code>Deploy success!</code> message displayed. Notice Netlify generated a random subdomain name<sup>2</sup>. I’ll change this in the next step.</p>
<p><a href="img/deploy-success.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-24"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/deploy-success.webp" class="img-fluid" alt="Netlify with 'Deploy Success!' screen that shows the the random domain generated after deploying the website."></a></p>
<p>I opened the <code>Site Configuration</code> tab, and opened the live website by clicking either the link (<code>https://jade-donut-3a47e4.netlify.app/</code>) or the preview thumbnail.</p>
<p>The auto-generated name is way too long and irrelevant to what my website is about. I renamed it by going to <code>Site details</code> and then <code>Change site name</code>.</p>
<p><a href="img/site-config.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-25"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/site-config.webp" class="img-fluid" alt="Netlify with boxes around the 'Site configuration' menu button, the live website link and preview, and the 'Site details' &amp; 'Change site name' buttons."></a></p>
<p>I changed the site name to <code>maitaiskye</code> so the URL for my website is <a href="https://maitaiskye.netlify.app/" class="uri">https://maitaiskye.netlify.app/</a>. The <code>netlify.app</code> part is not optional, unless you buy your own <a href="https://docs.netlify.com/domains-https/custom-domains/">domain name</a>.</p>
<p><a href="img/name-website.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-26"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/name-website.webp" class="img-fluid" alt="Netlify 'Change site name' dialog box."></a></p>
<p>Now we can see my website is live!</p>
<p><a href="img/live-website.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-27"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/live-website.webp" class="img-fluid" alt="Screenshot of the demo website that lives at maitaiskye.netlify.app."></a></p>
</section>
<section id="your-turn-5" class="level2" data-number="9.2">
<h2 data-number="9.2" class="anchored" data-anchor-id="your-turn-5"><span class="header-section-number">9.2</span> Your turn</h2>
<ol type="1">
<li>If you don’t yet have a Netlify account, <a href="https://app.netlify.com/signup">sign up</a> and log in.</li>
<li>Go to the <code>Sites</code> tab to access the drag &amp; drop tool and upload your <code>_site</code> folder.</li>
<li>Open and check out your newly deployed site.</li>
<li>Go to <code>Site configuration</code> to change your site name.</li>
<li>Congratulations! Your website is live! 🎉</li>
</ol>
</section>
<section id="buy-your-own-url" class="level2" data-number="9.3">
<h2 data-number="9.3" class="anchored" data-anchor-id="buy-your-own-url"><span class="header-section-number">9.3</span> Buy your own URL</h2>
<p>If you don’t want the <code>netlify.app</code> suffixed to your site name, you’ll need to purchase your own domain. Instead of <code>Site configuration</code>, go to <code>Domain management</code>, and then click <code>Add a domain</code>.</p>
<p><a href="img/domain-management.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-28"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/domain-management.webp" class="img-fluid" alt="Domain management part of Netlify site with option to add a domain."></a></p>
<p>Enter whatever custom domain you want. There are a bajillion different extensions – <a href="https://www.domain.com/domains/new-domain-extensions">domain.com</a> lists them alphabetically and has a helpful FAQ about domain extensions. <code>maitaiskye.com</code> is available for $13.99 for the first year.</p>
<p><a href="img/buy-domain.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-29"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/buy-domain.webp" class="img-fluid" alt="Add a custom domain to your site page on netlify. It says my-maitaiskye.com is available and costs $13.99 for the first year."></a></p>
</section>
</section>
<section id="update-your-website" class="level1" data-number="10">
<h1 data-number="10"><span class="header-section-number">10</span> Update your website</h1>
<p>When you make updates to your website, be sure to <code>Render Website</code> under the <code>Build</code> pane of RStudio to update the entire <code>_site</code> folder.</p>
<p>Log in to Netlify, click on your site, open the <code>Deploys</code> tab, and upload the <code>_site</code> folder.</p>
<p><a href="img/update.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-30"><img src="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/img/update.webp" class="img-fluid" alt="Netlify with boxes around the 'Deploys' side menu button and the Drag &amp; Drop tool."></a></p>
<p>Once it says <code>Published</code>, go check out your changes!</p>
</section>
<section id="resources" class="level1 unnumbered">
<h1 class="unnumbered">Resources</h1>
<p>When you’re ready for more advanced customization, check out these resources.</p>
<ul>
<li><a href="https://quarto.org/docs/authoring/markdown-basics.html">Markdown basics</a></li>
<li><a href="https://quarto.org/docs/websites/website-navigation.html">Website navigation</a></li>
<li><a href="https://quarto.org/docs/websites/website-tools.html">Website tools</a></li>
<li><a href="https://quarto.org/docs/reference/projects/websites.html">All Quarto website options</a> for <code>_quarto.yml</code></li>
<li><a href="https://quarto.org/docs/output-formats/html-themes.html">Themes and custom style sheets</a></li>
</ul>
</section>
<section id="wrap-up" class="level1 unnumbered">
<h1 class="unnumbered">Wrap up</h1>
<p>Building a website doesn’t have to be daunting, even if you have no technical background. With Quarto and Netlify, you can create and deploy a simple website with minimal pain. Start building your website today and share your creations with the world! Don’t forget to share your website in the comments below – I can’t wait to see what you create!</p>
<p>If you need additional assistance or prefer to have your website created for you, I’m available for consulting services or can handle the entire website creation process. Feel free to reach out for personalized assistance tailored to your needs!</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Acknowledgement
</div>
</div>
<div class="callout-body-container callout-body">
<p>Thank you <a href="https://www.andreashandel.com/">Andreas Handel</a> for the feedback on the first draft of this tutorial, and for the <a href="https://fosstodon.org/@andreashandel/111915048338377706">idea to create this beginner’s guide</a>!</p>
</div>
</div>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Generally, it’s good practice to not include special characters or spaces in the folder or file names. For example, if you want to name your website “My Website!!!”, name the folder “my-website”. Later, we will change how the website name displays in our configuration files.↩︎</p></li>
<li id="fn2"><p>This subdomain name is what comes before the <code>netlify.app</code> domain for the free tier of Netlify. I changed mine to <code>maitaiskye</code>, so the URL is <code>maitaiskye.netlify.app</code>.↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@online{ryan2024,
  author = {Ryan, Jadey},
  title = {A Beginner’s Guide to Building a Simple Website with {Quarto}
    \&amp; {Netlify}},
  date = {2024-02-19},
  url = {https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/},
  langid = {en}
}
</code></pre><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-ryan2024" class="csl-entry quarto-appendix-citeas">
Ryan, Jadey. 2024. <span>“A Beginner’s Guide to Building a Simple
Website with Quarto &amp; Netlify.”</span> February 19, 2024. <a href="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/">https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/</a>.
</div></div></section></div> ]]></description>
  <category>Quarto</category>
  <category>Netlify</category>
  <guid>https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/</guid>
  <pubDate>Mon, 19 Feb 2024 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2024-02-19_beginner-quarto-netlify/featured.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>Notes from live code review of {soils}</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2024-01-22_package-review/</link>
  <description><![CDATA[ 




<p>First off, I want to say that I’m strongly resisting my perfectionism and time-blocked this blog post to about one hour! This is a very vulnerable and unpolished post, so please be gentle. 😌</p>
<p>A couple days ago, three ✨<strong>expert</strong>✨ R package developers and reviewers looked at my package:</p>
<ul>
<li><a href="https://fosstodon.org/@njtierney@aus.social">Nicholas Tierney</a></li>
<li><a href="https://fosstodon.org/@milesmcbain">Miles McBain</a></li>
<li><a href="https://rstats.me/@adamhsparks">Adam Sparks</a></li>
</ul>
<p>The idea to livestream a R package review came from <a href="https://njtierney.com/"><strong>Nick Tierney</strong></a>. Others favorited, boosted, and commented on the <a href="https://aus.social/@njtierney/111780641044951873">Mastodon post</a>, including myself. I’ve been working on this <a href="https://github.com/WA-Department-of-Agriculture/soils">{soils} R package</a> and am in the review/revise period of package development. Before I could get second thoughts, I volunteered this package for review. I was quite nervous about putting my work out there for critique, but I’m so happy that I did. And so grateful that Nick, Miles, and Adam all shared their brilliance! 🧠😇</p>
<p>I’ve re-watched the session a few times to soak up all the gold nuggets of good practices, tips and tricks, and overall understanding of the package review process. Below, I’ve included the recording of the session, bullet point summaries of what I learned, what I did well, and what I can improve, and then my unpolished and mostly disorganized notes.</p>
<p>If you just want to see what changes Nick suggested, see his <a href="https://github.com/WA-Department-of-Agriculture/soils/pull/3">pull request with suggestions/changes</a>.</p>
<p>Please comment and let me know if you learned something new, or if you see something else I can improve in my package development journey!</p>
<section id="recording-of-live-code-review-session" class="level2">
<h2 class="anchored" data-anchor-id="recording-of-live-code-review-session">Recording of live code review session</h2>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/OttYnXwM4dU" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
</section>
<section id="new-tips-and-tricks-i-learned" class="level2">
<h2 class="anchored" data-anchor-id="new-tips-and-tricks-i-learned">New tips and tricks I learned</h2>
<ul>
<li><p>Use <a href="https://github.com/MangoTheCat/goodpractice"><code>goodpractice::gp()</code></a> to run a check for many good practices in R package development.</p></li>
<li><p>{cli} has special <a href="https://cli.r-lib.org/reference/inline-markup.html">inline markup classes</a>.</p></li>
<li><p><code>//</code> to add a new line in {cli} message. I bet this works with other long string arguments as well.</p></li>
<li><p><a href="https://usethis.r-lib.org/reference/use_package_doc.html"><code>usethis::use_package_doc()</code></a> generates basic package-level documentation.</p></li>
<li><p>Menu to open file or function: <code>Ctrl</code> + <code>.</code></p></li>
</ul>
</section>
<section id="things-i-did-well" class="level2">
<h2 class="anchored" data-anchor-id="things-i-did-well">Things I did well</h2>
<ul>
<li><p>Time and effort to make the user experience (UX) good: video demos, boxes and annotations for videos and screenshots, {pkgdown} website with detailed articles</p></li>
<li><p>Defensive programming: failing early and giving error messages</p></li>
<li><p>Using functions like <code>cat_red_bullet</code> and <code>cet_green_check</code> to set nice, informative {cli} message symbols</p></li>
<li><p>Consistent styling with <a href="https://github.com/gadenbuie/grkstyle">{grkstyle}</a></p></li>
<li><p>Including a URL reference to the exact commit of functions adapted from other packages</p></li>
<li><p>Including data dictionary was nice.</p></li>
<li><p>Generating example data from an R script to make it possible to reproduce.</p></li>
</ul>
</section>
<section id="things-to-improve" class="level2">
<h2 class="anchored" data-anchor-id="things-to-improve">Things to improve</h2>
<ul>
<li><p>Huge package size (not a big deal since using R-Universe instead of CRAN)</p></li>
<li><p>Incorporate testing</p></li>
<li><p>Error messages: take advantage of {cli} <a href="https://cli.r-lib.org/reference/inline-markup.html">inline markup</a>, provide an example of what the code <em>should</em> look like, tell the user if they need to provide something rather than say something is missing</p></li>
<li><p>Better use explaining variables in conditional statements to unravel confusing ifelse logic.</p></li>
<li><p>More consistency with approaches / utilities: base R or tidyverse</p></li>
<li><p>Naming things is so hard! Mixing snake_case and camelCase in the example data and data dictionary.</p>
<ul>
<li>Things to look into: <a href="https://fediscience.org/@bbolker/111791764707599216">comments responding to Ben Bolker’s Mastodon post</a>, <a href="https://www.pipinghotdata.com/posts/2022-09-13-the-case-for-variable-labels-in-r/">Shannon Pileggi’s post</a>, <a href="https://emilyriederer.netlify.app/post/column-name-contracts/">Emily Riederer’s post</a>, <a href="https://rdatatable.gitlab.io/data.table/reference/setattr.html"><code>data.table::setattr()</code></a>, and <a href="https://r-quantities.github.io/units/">{units}</a> thanks to <a href="https://fosstodon.org/@mccarthymg/111792645556619721">Michael McCarthy</a>.</li>
</ul></li>
<li><p>Be more descriptive with example data: call it <code>washi_example</code> instead of <code>exampleData</code> and include data viz.</p></li>
<li><p>Investigate <code>ggtern</code> overwriting <code>ggplot2</code> S3 methods warning more closely, resolve or rethrow more helpful warning text instead of using <code>suppressWarnings()</code>.</p></li>
<li><p>Write better commit messages following the template: “this commit will…” and use headlines and bullet points.</p></li>
</ul>
</section>
<section id="notes" class="level2">
<h2 class="anchored" data-anchor-id="notes">Notes</h2>
<p>There are lots of notes of things Nick would wanted to “get to later” but we ran out of time. I left these notes in just to draw attention to other things we would have looked at more closely given more time.</p>
<section id="look-at-the-github-repo." class="level3">
<h3 class="anchored" data-anchor-id="look-at-the-github-repo.">Look at the GitHub repo.</h3>
<p><strong>About</strong>: provides context, a few features, and link to website.</p>
<p><strong>Website</strong>: video demos in README and main page of website</p>
<ul>
<li><p>Author cares about UX and make it easy to understand what the benefit of the package</p></li>
<li><p>Taking time to add boxes and annotations to videos and screenshots really helpful.</p></li>
<li><p>Empathy for R users who haven’t been using R for very long. Videos help take the user’s hand and walk them through it.</p></li>
</ul>
<p><strong>Articles</strong>: will get to later.</p>
<ul>
<li>Repo and website gives trust that the author wants the pkg to be easily usable and understandable.</li>
</ul>
</section>
<section id="fork-the-package-and-copy-to-machine" class="level3">
<h3 class="anchored" data-anchor-id="fork-the-package-and-copy-to-machine">Fork the package and copy to machine</h3>
<p>Used RStudio with New Project from Version Control.</p>
<p>Took a long time to clone. Not a big deal unless want the pkg on CRAN. Will get to later.</p>
<ul>
<li><p>Large R package. Likely from the example .docx and .html reports that are included.</p>
<ul>
<li>Look at README to see where video demos came from. Uses GitHub assets, so not included in pkg download. See how to do this in <a href="https://www.youtube.com/watch?v=G3Cytlicv8Y">GitHub’s video</a>.</li>
</ul></li>
</ul>
<p>Create new branch for changes/suggestions.</p>
</section>
<section id="run-goodpracticegp" class="level3">
<h3 class="anchored" data-anchor-id="run-goodpracticegp">Run <code>goodpractice::gp()</code></h3>
<p>Nick’s experience as <a href="https://ropensci.org/">ROpenSci</a> pkg reviewer to run this static analysis on the code. Makes markers for things that are easy to fix in the pkg.</p>
<p><a href="https://github.com/MangoTheCat/goodpractice">{goodpractice} repo</a></p>
<p>Run <code>devtools::install_dev_deps()</code> to install everything for the pkg.</p>
<p>Markers:</p>
<ul>
<li><p>Code lines that are &gt; 80 characters long.</p></li>
<li><p>No tests</p>
<ul>
<li><p>Tests are hard. Not sure how to do this with a project template based pkg. Will get back to this.</p></li>
<li><p><strong>Miles</strong>: “Yeah so I think testing is hard here because the RStudioApi shows up pretty early in the workflow. To make things easier you could try to separate out as much possible work that can be done without it. then you contain the RStudioAPI stuff in a thin wrapper that wraps the functions that do the work. you can test the ‘do the work’ functions. although it does appear the API is made optional!”</p></li>
<li><p><strong>Adam</strong>: “You can use tempdir() as in your example for create_soils() and just check that the directories exists in tempdir() and are created as you expect.”</p></li>
<li><p><strong>Miles</strong>: “yeah or maybe there’s a way to make the test for the RStudio API return false in non interactive mode. so put in &amp;&amp; interactive() there. then you can run your tests inside RStudio without hitting the API branch.”</p></li>
<li><p><strong>Adam</strong>: “I could see writing tests to circumvent the API would be useful, perhaps you could use it as a basis for automating a scripted setup that wasn’t interactive?”</p></li>
</ul></li>
<li><p>UTF-8 strings? not sure how to fix</p></li>
<li><p>Big installation size</p>
<ul>
<li><strong>Adam</strong>: “Size isn’t a big issue if you don’t plan to put it on CRAN”</li>
</ul></li>
<li><p>Not big deal breakers</p></li>
</ul>
</section>
<section id="look-through-.r-files" class="level3">
<h3 class="anchored" data-anchor-id="look-through-.r-files">Look through <code>.R</code> files</h3>
<section id="create_soils.r" class="level4">
<h4 class="anchored" data-anchor-id="create_soils.r"><code>create_soils.R</code></h4>
<ul>
<li><p><strong><code>roxygen</code> function documentation</strong></p>
<ul>
<li><code>@examples</code>: how would you use this? Create a soils project like a template R package in the given directory.</li>
</ul></li>
<li><p><strong>Function definition</strong></p>
<ul>
<li>Nice defensive programming with missing path giving error.</li>
</ul></li>
<li><p><strong>Error messages</strong></p>
<ul>
<li><p><strong>Improvement</strong>: use inline markup syntax in {cli} instead of back ticks for code. Instead of <code>"`path` is missing."</code>, use <code>"{.code path} is missing."</code></p></li>
<li><p>All classes are in <a href="https://cli.r-lib.org/reference/inline-markup.html"><code>inline-markup</code> of {cli}</a></p></li>
<li><p>Changed <code>"{.code path} is missing."</code> → <code>"{.path path} is missing."</code></p></li>
<li><p>Keyboard shortcut <code>Ctrl</code>+<code>Shift</code>+<code>L</code> to call <code>devtools::load_all(".")</code>.</p>
<ul>
<li>Got message about <code>ggtern</code> overwriting <code>ggplot2</code> S3 methods. Come back to this later.</li>
</ul></li>
<li><p>Ran <code>create_soils()</code> with path missing to see error. This opened in Browser/debug mode.</p></li>
<li><p><strong>Improvement</strong>: add another info message with example:<br>
<code>"i" = "For example, {.code create_soils('path/to/my/directory')}"</code></p></li>
<li><p>Re-ran interactively to see updated error msg. Nice to not worry about including back ticks.</p></li>
<li><p><strong>Improvement</strong>: can render the actual path by wrapping it in another pair of curly braces like: <code>"{.path {path}} already exists."</code>.</p></li>
<li><p><strong>Improvement</strong>: add another info message with example and use <code>\\</code> to create a new line:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"To always overwrite: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span></span>
<span id="cb1-2"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">{.code create_soils({.path {path}} overwrite = TRUE)}"</span></span></code></pre></div></div></li>
<li><p>Liked <code>cat_red_bullet</code> a lot. Defined in <code>utils.R</code></p></li>
</ul></li>
<li><p><strong>Recommend interactive process</strong></p>
<ul>
<li>Tweak something, load the pkg (<code>load_all</code>), then play around in the console.</li>
</ul></li>
<li><p><strong>Logic of function</strong></p>
<ul>
<li><p><code>if (!isTRUE(overwrite))</code>:</p>
<ul>
<li>Could have used <code>if (isFALSE(overwrite))</code> but good practice to leave it as is since <code>overwrite</code> is user-defined</li>
</ul></li>
<li><p>Too much ifelse nesting. Referred to <a href="https://github.com/jennybc/code-smells-and-feels">Jenny Bryan’s Code Smells talk</a>.</p>
<ul>
<li><p><strong>Improvement</strong>: prioritize happy path. Failing early is good. Extract conditions into explaining variables (<code>dir_exists</code> and <code>overwriting</code>). Then use 3 if statements to emphasize each individual case:</p>
<ul>
<li><p><code>if (dir_exists &amp;&amp; !overwriting) {...}</code></p></li>
<li><p><code>if (dir_exists &amp;&amp; overwriting) {...}</code> good to inform user of overwriting existing project</p></li>
<li><p><code>if (!dir_exists) {...}</code></p></li>
</ul></li>
</ul></li>
<li><p>Would run {grkstyle} at this point after a chunk of refactoring if Nick had it installed.</p></li>
<li><p>Could consider wrapping each case into a function itself like <code>stop_if_dir_exists_and_overwriting(dir_exists, overwriting) {...}</code> to capture the intent. Reduces lines of code. Not a believer of just reducing lines of code. But is believer of writing functions to express yourself. Makes it eaier to browse through the code and maintain later. <a href="https://www.njtierney.com/post/2023/12/06/long-errors-smell/">Nick’s blog post of these thoughts</a>.</p></li>
<li><p><code>soils_sys()</code> in <code>utils.R</code>: really liked the fixed blob URL for the exact commit in {golem} for code reference.</p></li>
</ul></li>
<li><p><strong>Code style</strong></p>
<ul>
<li><p><strong>Miles</strong>: “Things are looking pretty clean. Did you use {styler} along the way?”.</p>
<ul>
<li>I used <a href="https://github.com/gadenbuie/grkstyle">{grkstyle}</a> from Garrick Aden-Buie.</li>
</ul></li>
<li><p><strong>Miles</strong>: “One comment I would make having looked around a bit, which is visible here. There are some mixing of approaches / utilities. E.g. base::normalizePath shows up alongside fs:: stuff.”</p>
<ul>
<li><p><strong>Miles</strong>: “I think it’s safer to keep within one tool’s conception of how things are, otherwise subtle differences in underlying objects / assumptions can create edge cases where things break”</p></li>
<li><p><strong>Miles</strong>: “fs::path_norm and fs::path_real are worth a look”</p></li>
<li><p>Looked at what <code>normalizePath()</code> does with <code>?normalizePath</code></p>
<ul>
<li>Was going to rewrite it, but doesn’t fully understand so will leave it.</li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</section>
<section id="data.r" class="level4">
<h4 class="anchored" data-anchor-id="data.r"><code>data.R</code></h4>
<ul>
<li><p>Didn’t like mix of snake_case and camelCase. If this is a norm in the community, that’s okay.</p>
<ul>
<li><p><strong>Adam</strong>: “I picked this up too,the functions and some data are snake case but some data are camel case. I’d be consistent for myself and users. For better or worse, I tend to use”.” For separators with units in colnames.”</p></li>
<li><p><strong>Miles</strong>: “put units in brackets so you regex them out? or maybe a better engineer would suggest storing them as attributes. Or you have vectors of objects with units if they’re really important to calculations. Oooh oooh {roxyglobals}”</p></li>
<li><p><strong>Adam</strong>: “Most times in my work the units aren’t important for calculations but for knowing how it was recorded”</p></li>
<li><p>Naming things and units are hard. I use camel case to delineate words and underscores to separate soil health measurement from the unit. The underscores make pivoting easier.</p></li>
</ul></li>
<li><p><strong>Improvement</strong>: instead of calling it <code>exampleData</code>, call it something more descriptive like <code>washi_example</code>.</p></li>
<li><p><strong>Improvement</strong>: add example table or data viz to show some of things I care about.</p></li>
<li><p>Data dictionary is really nice: shows what the columns are and what they mean.</p></li>
<li><p>Can quickly normalize names with <code>janitor::clean_names()</code>.</p></li>
</ul>
</section>
<section id="data-rawexample_data.r" class="level4">
<h4 class="anchored" data-anchor-id="data-rawexample_data.r"><code>data-raw/example_data.R</code></h4>
<ul>
<li>Great to have this included so it’s possible to reproduce the example data. Good signals that I care about this.</li>
</ul>
</section>
<section id="globals.r" class="level4">
<h4 class="anchored" data-anchor-id="globals.r"><code>globals.R</code></h4>
<ul>
<li><p>Avoids CRAN check issue.</p></li>
<li><p><strong>Improvement</strong>: <code>usethis::use_package_doc()</code> creates a <code>soils-package.R</code> file.</p>
<ul>
<li><p>Could move <code>utils::globalVariables()</code> into this file and remove <code>globals.R</code>. Having globals in own R file is fine. Actually kinda like it there.</p></li>
<li><p>Look at <a href="https://github.com/tidyverse/dplyr/blob/main/R/dplyr.R">dplyr</a> or <a href="https://github.com/njtierney/naniar/blob/master/R/naniar-package.R">narniar</a> for examples.</p></li>
<li><p>Include <code>if(getRversion() &gt;= "2.15.1")  utils::globalVariables(c("."))</code> in <code>soils-package.R</code> with globals. Not sure if this is needed?</p></li>
</ul></li>
</ul>
</section>
<section id="helpers.r" class="level4">
<h4 class="anchored" data-anchor-id="helpers.r"><code>helpers.R</code></h4>
<ul>
<li><p><code>calculate_mode()</code>: R doesn’t include mode function.</p>
<ul>
<li><strong>Adam</strong>: “Oh! Watch the mode. I’ll check your function in a bit, but I’ve a function that allows you to handle multimodal distributions if you’d like. I got burned by my initial function to calculate mode. OK, you’ve got the max. That’s good. I don’t recall what I did first off but I would get the max or min from a multimodal distribution, so I wrote this <a href="https://adamhsparks.codeberg.page/misc.debris/reference/mode.html">[function]</a> that handles multimodal distributions”</li>
</ul></li>
<li><p>Noticed use of base pipe.</p>
<ul>
<li><p>Updated DESCRIPTION to depend on R ≥ 4.1.</p></li>
<li><p>Fancy triangle ligature from FiraCode-Light</p></li>
</ul></li>
<li><p>Running out of time so super quick review</p></li>
</ul>
</section>
<section id="plots.r" class="level4">
<h4 class="anchored" data-anchor-id="plots.r"><code>plots.R</code></h4>
<ul>
<li><p>Interested in the S3 methods overwritten by <code>ggtern</code> warning. Indicates something is going on but not sure what.</p></li>
<li><p>Optional: instead of namespacing <code>ggplot2::</code>, can add <code>#' @import ggplot2</code> to the <code>soils-package.R</code> which is kinda like running <code>library(ggplot2)</code>.</p></li>
<li><p>Really likes consistent styling. Makes code easy to read. Can turn off parts of brain to focus on various things.</p></li>
<li><p>Doesn’t have time to confidently to go through plotting code.</p></li>
<li><p><strong>Miles</strong>: “I’d like to hear Dr Nick’s opinion on plots.R line 22”</p>
<ul>
<li><p><code>suppressWarnings</code> wrapped around <code>make_texture_triangle</code> {ggplot2} code.</p></li>
<li><p>Not sure why suppressing warnings. Add comment at closing parentheses. No warnings when Nick ran the function example.</p></li>
<li><p><strong>Miles</strong>: “You can even catch and rethrow with more relevant text if that would be helpful to people”</p></li>
</ul></li>
</ul>
</section>
</section>
<section id="vignettes" class="level3">
<h3 class="anchored" data-anchor-id="vignettes">Vignettes</h3>
<p>Look at <code>get-started.Rmd</code> to understand if it’s all point and click or if there’s code to run:</p>
<ul>
<li><p><strong>Installation</strong>: using r-universe (project by ROpenSci), like an alternative to CRAN. Shows author cares about user.</p></li>
<li><p>See Option 2: RStudio Console</p>
<ul>
<li><p>Project structure tree: great and takes time</p></li>
<li><p>From annotated screenshots, strong effort to make this easily usable</p></li>
</ul></li>
</ul>
<p>Back to R code: <code>create_soils()</code> in <code>create_soils.R</code></p>
</section>
<section id="build-pkg-and-create-soils-project" class="level3">
<h3 class="anchored" data-anchor-id="build-pkg-and-create-soils-project">Build pkg and create soils project</h3>
<p>Follow the point and click instructions for install {soils} with RStudio new project wizard.</p>
</section>
<section id="testing" class="level3">
<h3 class="anchored" data-anchor-id="testing">Testing</h3>
<p><code>usethis::use_testthat()</code></p>
<p><code>usethis::use_test("create-soils")</code> to create <code>test-create-soils.R</code> template to modify.</p>
<ul>
<li>Likes dashes over underscores for file names to make it easier to mouse across when holding <code>Alt</code> (<a href="https://www.youtube.com/live/OttYnXwM4dU?si=vA2_CjRtt5tNQBg5&amp;t=4026">1:07:06 timestamp for demoing this</a>). If using underscores, it jumps to the very end.</li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">test_that</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"create_soils returns appropriate error"</span>, {</span>
<span id="cb2-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expect_snapshot_error</span>(</span>
<span id="cb2-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">create_soils</span>()</span>
<span id="cb2-4">  )</span>
<span id="cb2-5">})</span></code></pre></div></div>
<p>Running it once took a snapshot of the error message, which got saved in <code>tests/testthat/_snaps/create-soils.md</code>.</p>
<p>Running it again shows the test passed.</p>
<p>Changed <code>"`path` is missing."</code> → <code>"{.path path} must be provided."</code>.</p>
<ul>
<li>Tells user you must provide the path. You need to do this thing.</li>
</ul>
<p>Run test again. It says the message has changed.</p>
<p>Click <code>testthat::snapshot_review('create-soils') to interactively review this change.</code></p>
<p>Shows the diff, which is what we want. Click <code>Accept</code>.</p>
<p>Good for snapshotting errors and outputs!</p>
</section>
<section id="commit-push-pr" class="level3">
<h3 class="anchored" data-anchor-id="commit-push-pr">Commit, push, PR</h3>
<p>Committed each individual change one at a time with descriptive commit messages.</p>
<p>Write commit messages following this template:</p>
<ul>
<li><p>[this commit will]… * use tests and snapshot testing</p></li>
<li><p>[this commit will]… * depend on R 4.1.0 since |&gt; is used</p></li>
</ul>
<p>Then add a summary headline:</p>
<ul>
<li>Tests, snapshots, base pipe:</li>
</ul>
<p>All together, the commit message:</p>
<pre><code>Tests, snapshots, base pipe:
* use tests and snapshot testing
* depend on R 4.1.0 since |&gt; is used</code></pre>
<p>Credit to Adam Brewer (spelling?) for this commit message template of “This commit will…” to remember what he commit does.</p>
<p>Credit to Miles for idea of using the header and dot points.</p>
<p>Push then submit <a href="https://github.com/WA-Department-of-Agriculture/soils/pull/3">PR with suggestions/changes</a>!</p>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@online{ryan2024,
  author = {Ryan, Jadey},
  title = {Notes from Live Code Review of \{Soils\}},
  date = {2024-01-22},
  url = {https://jadeyryan.com/blog/2024-01-22_package-review/},
  langid = {en}
}
</code></pre><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-ryan2024" class="csl-entry quarto-appendix-citeas">
Ryan, Jadey. 2024. <span>“Notes from Live Code Review of
{Soils}.”</span> January 22, 2024. <a href="https://jadeyryan.com/blog/2024-01-22_package-review/">https://jadeyryan.com/blog/2024-01-22_package-review/</a>.
</div></div></section></div> ]]></description>
  <category>R</category>
  <category>Quarto</category>
  <category>Package dev</category>
  <category>Code review</category>
  <category>Reflection</category>
  <guid>https://jadeyryan.com/blog/2024-01-22_package-review/</guid>
  <pubDate>Mon, 22 Jan 2024 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2024-01-22_package-review/featured.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>2023: a year of firsts</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2023-12-31_year-of-firsts/</link>
  <description><![CDATA[ 




<section id="celebrating-our-collective-survival" class="level1">
<h1>Celebrating our collective survival</h1>
<p><a href="https://www.instagram.com/p/C1h8ggNRELm/"><img src="https://jadeyryan.com/blog/2023-12-31_year-of-firsts/new-year.webp" class="img-float-right img-fluid" alt="Four panel comic featuring two cute aliens wearing party hats. by Nathan W Pyle. In the first panel, an alien says we celebrate because we completed a revolution around the star. The second panel shows the other alien asking so it is identical to emergence day? The other alien responds emergence day in for one individual's survival! The third panel says New Revolution's day celebrates collective survival. The last panel shows the aliens with their hands in the air exclaiming we did not die and the other saying exactly!" width="400"></a> Getting up and surviving each of the last 365 days is an accomplishment in itself. We’re all still adjusting from the COVID-19 pandemic phase to the endemic phase; dealing with changes from remote to hybrid or in-person work; and coping with the current state of politics, economics, climate disasters, and war. As we reflect on our year, I hope we can honor the lives lost, lessons learned, and feel proud that, despite all that’s wrong in the world, we managed to keep our heads above water.</p>
<p>For the last week, I’ve been thinking about my experience through 2023 and been considering writing the cliche end of year review post. It’s 9:09 PM on 123123 and I’ve decided I do want to jot down my reflections – raw and unedited. Typos, rambling, incoherence, and disorganization guaranteed 😉.</p>
</section>
<section id="from-2022-to-2023" class="level1">
<h1>From 2022 to 2023</h1>
<p>The year started off pretty rough for me. This was my second year in this data scientist role where everything (soil science, data management, programming) was new to me. I was disappointed in myself because I only accomplished about half of my 2022 goals and worried that I was also disappointing my supervisor and colleagues. I was wondering if I made a mistake in this career transition from a field-based environmental scientist to a data scientist. On a daily basis, I really struggled with imposter syndrome and worried that I was holding back these important statewide programs and initiatives because I was slow and needed to learn so much on the job.</p>
</section>
<section id="first-rejection" class="level1">
<h1>First rejection</h1>
<p>I submitted a talk proposal to present <a href="https://wsda.shinyapps.io/WaCSE/">{WaCSE}</a>, my first Shiny app used for a statewide agricultural grant program, at <a href="https://shinyconf2023.appsilon.com/">Appsilon’s Shiny Conf</a>. I submitted the abstract at the end of 2022 and got the rejection notice at the end of January 2023. This was my third conference proposal I’ve ever submitted in the four years of my professional career and my first rejection. My learned lesson here was to put more thought into which category I submit to (20-min talk versus showcase section) and make the idea more unique. The feedback from the review committee was that my talk fell under the category “tools to facilitate data access” and there were quite a few of those. This rejection certainly added to my feelings of being an imposter and not deserving my job.</p>
<p>Though with the support and encouragement of my supervisor, I kept trying and also submitted talk proposals for 2023 Cascadia R Conf and posit::conf(2023).</p>
</section>
<section id="one-projecttalk-many-firsts" class="level1">
<h1>One project/talk, many firsts</h1>
<p>In March, things started to look more hopeful as I got my first invitation to speak at an <a href="https://rladiesseattle.org/">R-Ladies Seattle</a> lightning talk event: <em>R in the Outdoors</em>. This one invitation led to so many of my firsts including my:</p>
<ul>
<li>first invitation to speak</li>
<li>first web scraping project</li>
<li>first R package</li>
<li>first in-person talk</li>
<li>first R-Ladies Seattle event</li>
<li>first Seattle useR group event</li>
</ul>
<p>While these all are huge accomplishments to me, I also realize that it’s totally natural because I am so new to the R and coding space. Nevertheless, April 20, 2023 was a huge day for me as this was the first moment since RStudio::con(2022) that I really felt a sense of belonging in the R community.</p>
<p><img src="https://jadeyryan.com/talks/2023-04-20_rladies_orcas-web-scraping/featured.webp" class="img-float-right img-fluid" alt="Slide titled 'Mapping with whale icons!' with screenshot of leaflet map with whale icons representing the start and end of the encounters." width="300"> This was also my first in-person talk of my professional career! I used this as an opportunity to learn new skills through a personal project. I’ve always had an affinity for the Southern Resident Killer Whales in the Salish Sea. The <a href="https://www.whaleresearch.com">Center for Whale Research</a> does a lot of really fascinating and important work monitoring their population. They post their survey data on their website; each encounter with the orcas is a separate webpage. I’d been curious and intimidated by web scraping so I decided this would make a great case study and personal project.</p>
<p>With the encouragement from new friends I met at the R-Ladies event, we ended up also going to the <a href="https://www.meetup.com/seattle-user/">Seattle useR Group</a> lightning talks meetup afterwards. I spontaneously gave the same presentation there!</p>
<p>Check out the {orcas} package <a href="https://github.com/jadeynryan/orcas">repo</a> and <a href="../../talks/2023-04-20_rladies_orcas-web-scraping/index.html">talk materials</a>.</p>
</section>
<section id="first-wade-attendance-talk" class="level1">
<h1>First WADE (attendance &amp; talk)</h1>
<p><img src="https://jadeyryan.com/talks/2023-06-13_wade_washi-wacse/featured.webp" class="img-float-right img-fluid" alt="Screenshot of slide with many different colored and textured soils and the text: we need diverse solutions for diverse soils.." width="300"> Outside of the R community and moreso in my capacity as the data scientist at the Washington State Department of Agriculture, I was invited to present at the Washington Association of District Employees (WADE). I presented on the <a href="https://washingtonsoilhealthinitiative.com/">Washington Soil Health Initiative</a> and <a href="https://wsda.shinyapps.io/WaCSE/">{WaCSE}</a>.</p>
<p>See the <a href="../../talks/2023-06-13_wade_washi-wacse/index.html">talk materials</a>.</p>
</section>
<section id="first-master-of-science-degree" class="level1">
<h1>First Master of Science degree</h1>
<p>In August, I graduated from <a href="https://landresources.montana.edu/grad/gradonline.html">Montana State University’s online Land Resources and Environmental Sciences program</a> with a Master of Science. It took me about three years of part-time school with full-time work to complete this degree. I really enjoyed the online aspect of the program as it allowed me to really focus on what was applicable to my job, rather than rote memorization of lots of content I didn’t really need for my day-to-day work. I am a big proponent of <em>learning how to learn</em> in primary and secondary education [thanks dad for teaching me this mentality ☺️], and then using those learning skills to dive deeper into a domain you want to pursue for postsecondary education.</p>
<p>For my professional project (aka the cheaper version of a thesis), I got to learn some JavaScript and Google Earth Engine to model wind-driven soil erosion in Washington State’s Columbia Plateau.</p>
<p>See the <a href="https://github.com/jadeynryan/erosion">repo</a> and my <a href="https://youtu.be/5IA3JaCnMFs?si=6ZQZSsr31Hjf479F">presentation recording</a>.</p>
</section>
<section id="first-cascadia-conf-attendance-talk" class="level1">
<h1>First Cascadia Conf (attendance &amp; talk)</h1>
<p><img src="https://jadeyryan.com/blog/2023-12-31_year-of-firsts/cascadia.webp" class="img-float-right img-fluid" alt="Me smiling while presenting at Cascadia R Conf 2023." width="300"> Given my rejection for Shiny Conf, I definitely didn’t expect to be accepted for <a href="https://cascadiarconf.com/">Cascadia R Conf</a> or Posit. I used the lessons from my first proposal and made this proposal more unique by focusing less on the Shiny app as a data access tool, and more on the development process and lessons learned from creating our first Shiny app.</p>
<p>See the <a href="../../talks/2023-08-19_cascadia_shiny-wacse/index.html">talk materials</a>.</p>
<p>This was my first time attending Cascadia Conf and I’ve got to say that it is an endearing and enlightening experience. It’s more local and tight-knit than RStudio/Posit conf. I appreciated the smaller size, venue, and one track style of conference. I really enjoyed meeting people I’ve known online in person and making entirely new friends and connections. I loved the experience so much that I volunteered to be on the planning committee for 2024 conf! I’ll be working on the hex logo, paper materials, the <em>witty</em> committee to come up with quirky, fun activities, and helping to update the <a href="https://cascadiarconf.com">website</a>.</p>
</section>
<section id="first-posit-conf-talk" class="level1">
<h1>First Posit Conf talk</h1>
<p><img src="https://jadeyryan.com/blog/2023-12-31_year-of-firsts/posit.webp" class="img-float-right img-fluid" alt="Me smiling while presenting at posit::conf(2023)." width="300"> Since I already revised the {WaCSE} Shiny talk from the Appsilon Shiny Conf proposal for Cascadia R Conf, I wanted to submit a different topic just in case. So I decided to try a talk about the parameterized soil health Quarto reports. Getting my talk proposal accepted for <a href="https://posit.co/conference/">posit::conf</a> was probably the most shocking news I had for 2023. The call for proposals required an abstract and a 1-minute video pitching the idea for the talk and what I hope the audience will walk away with. I was incredibly intimidated but the amazing <a href="https://www.linkedin.com/in/rachaeldempsey/">Rachael Dempsey</a> wrote a very encouraging and helpful <a href="https://www.linkedin.com/posts/rachaeldempsey_positconf-activity-7043697290061971456-ts01">LinkedIn post</a> for those nervous about the video.</p>
<details>
<summary>
Read Rachael’s post
</summary>
<iframe src="https://www.linkedin.com/embed/feed/update/urn:li:share:7043697288497516545" height="800" width="504" frameborder="0" allowfullscreen="" title="Embedded post">
</iframe>
</details>
<p>I strongly encourage anyone to submit a talk for next year’s conference in Seattle! You never know if you don’t at least try. Posit provides speaker coaching through <a href="https://www.articulationinc.com/">Articulation</a>, which is so incredibly helpful for learning how to weave a story into your presentation, even with code-based content.</p>
<p>See the <a href="../../talks/2023-09-25_posit_parameterized-quarto/index.html">talk materials</a>.</p>
</section>
<section id="general-thoughts-from-my-four-talks-this-year" class="level1">
<h1>General thoughts from my four talks this year</h1>
<p>I’ve always been extremely nervous about public speaking. So much anxiety, shaking, sweating, red face, voice cracking, and lightheadedness that I would take propranolol to help. This year I didn’t need it though. I definitely felt nervous and shaky. But not to the same extent. Once I got started presenting, I (for the most part) felt nervous-excited to share whatever I was talking about.</p>
<p>Reflecting on how I felt each talk, I’ve realized that I’m naturally more confident talking about things that I really care about and am professionally and personally invested in. Instead of presenting random research for school projects in my high school and undergraduate classes, I’m presenting projects that I’ve invested dozens of hours in learning, crafting, and perfecting.</p>
</section>
<section id="first-invitation-for-a-workshop" class="level1">
<h1>First invitation for a workshop</h1>
<p><img src="https://secure.meetupstatic.com/photos/event/9/7/5/4/600_517358740.webp?w=750" class="img-float-right img-fluid" alt="Poster for Parameterized reporting using Quarto 2-hour workshop, presented by Jadey Ryan and hosted by R-Ladies Washington D.C. January 18th, 2024 at 6:30 EDT." width="300"> After my posit::conf talk, <a href="https://www.linkedin.com/in/aratikrishnamoorthy/">Arati Krishnamoorthy</a> came up to me to congratulate me on my presentation and ask if I was interested in leading a workshop as a longer version of my talk on parameterized Quarto reports. Of course I said yes, even though I’ve never led a workshop before. It’ll be my <em>first</em> first [workshop] of 2024 on January 18th!</p>
<p>Register for the <a href="https://www.meetup.com/rladies-dc/events/297344107/">R-Ladies Washington D.C. Meetup</a>.</p>
<p>So far, I’ve really enjoyed these R focused presentations and teaching. Depending on how the workshop goes, I’m considering applying for <a href="https://docs.carpentries.org/topic_folders/instructor_training/trainers_training.html">The Carpentries Trainer Training Program</a> to better learn how to teach. After all, my husband is an instructional coach (with 5 years of elementary teaching under his belt).</p>
</section>
<section id="first-personal-website-and-blog" class="level1">
<h1>First personal website and blog</h1>
<p><a href="https://www.linkedin.com/in/millie-symns/">Millie Symnns</a> wrote a <a href="https://milliesymns.com/blog/2022-12-28-side-effects-of-a-year-of-blogging/">blog post</a> and gave an excellent <a href="https://youtu.be/PQvnizEJ2eQ?si=2V6386gPdjtylfKJ">posit::conf(2023) talk</a> about the side effects of blogging that inspired me to create my own website and blog. Since RStudio::Conf(2022), I’ve been obsessed with Quarto so the technology behind a website and blog obviously had to be Quarto. It was a blast coming back from Posit Conf and immediately applying what I learned to build my own personal portfolio and website.</p>
</section>
<section id="first-small-business---etsy-shop" class="level1">
<h1>First small business - Etsy shop</h1>
<p>At Cascadia Conf and Posit Conf, I used my Cricut and heat transfer vinyl to create my own cat and code themed shirts to wear as conversation starters. At both conferences, I made new friends because I was approachable and immediately had <em>two</em> common interests to talk about (R and cats 😻). People asked where I got my shirts and encouraged me to make them available. So to spread the joy and allow others to proudly share/wear their interests, I set up a sole proprietorship, started a small business called <strong>The Coding Cats</strong>, and launched an Etsy shop found at <a href="https://thecodingcats.etsy.com">thecodingcats.etsy.com/</a>!</p>
<p>In 2024, I hope to move from Etsy to a Shopify store that lives on the <a href="https://jadeyryan.com/shop">The Coding Cats tab</a> of my website to avoid the excessive Etsy fees.</p>
</section>
<section id="first-freelance-job" class="level1">
<h1>First freelance job</h1>
<p>Lastly, my first freelance job sort of fell into my lap when a friend referred me to one of their colleagues who was looking for someone to convert their RMarkdown website to Quarto. I picked the brain of my friend to learn about freelancing, listened to some episodes of <a href="https://www.thebusinessofauthority.com/">The Business of Authority podcast</a>, decided on <a href="https://jonathanstark.com/trust-fractures-how-hourly-billing-hurts-software-projects">project-based billing</a> rather than hourly billing, consulted with the client, wrote up a proposal, and then began the work.</p>
<p>I actually just finished the next stage of the project earlier today 😀.</p>
<p>While I’m not actively looking for freelance work, I’m happy to entertain the idea and set up a short call to see if I would be a good fit for your project if it involves pretty much anything Quarto.</p>
</section>
<section id="last-thoughts" class="level1">
<h1>Last thoughts</h1>
<p>I appreciate you sticking through my ramblings (including my future self)!</p>
<p>The year started out with imposter syndrome, so much self-doubt, and one rejection. But with the support from my community, I kept on keeping on. My general theme for the year was perseverance through failures and insecurities to finally get to the realization that I’m exactly where I’m supposed to be. I’m learning as I go, and that’s perfectly okay! My learning directly feeds into my sense of belonging within the R community. This community is so amazing at lifting each other up as we all learn together and support each other. We’re all collectively trying to use the latest technologies and best practices to gain insights from our data and make the world a better place.</p>
<p>Here’s to 2024 being another year of learning, being vulnerable, and lifting each other up!</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@online{ryan2023,
  author = {Ryan, Jadey},
  title = {2023: A Year of Firsts},
  date = {2023-12-31},
  url = {https://jadeyryan.com/blog/2023-12-31_year-of-firsts/},
  langid = {en}
}
</code></pre><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-ryan2023" class="csl-entry quarto-appendix-citeas">
Ryan, Jadey. 2023. <span>“2023: A Year of Firsts.”</span> December 31,
2023. <a href="https://jadeyryan.com/blog/2023-12-31_year-of-firsts/">https://jadeyryan.com/blog/2023-12-31_year-of-firsts/</a>.
</div></div></section></div> ]]></description>
  <category>Reflection</category>
  <guid>https://jadeyryan.com/blog/2023-12-31_year-of-firsts/</guid>
  <pubDate>Sun, 31 Dec 2023 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2023-12-31_year-of-firsts/featured.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>Intermediate guide to publish a Quarto website with GitHub &amp; Netlify</title>
  <dc:creator>Jadey Ryan</dc:creator>
  <link>https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/</link>
  <description><![CDATA[ 




<p>Thankfully, many amazing <a href="https://github.com/mcanouil/awesome-quarto">resources</a> for building beautiful websites and blogs with Quarto already exist. Instead of adding to that pool of content, I’ll demo how I built my website with Quarto, connected to a GitHub repository, and then deployed and published with Netlify <a href="https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git">continuous deployment</a>. Special thanks to <a href="https://libbyheeren.com">Libby Heeren</a> for testing this demo and helping me clarify some sticky points! ♥️</p>
<p>I struggled for hours trying to set up the configurations so my site would deploy every time I pushed a change to my GitHub repo. Hopefully this demo saves you some time when you start your own website! :)</p>
<p>As with most tech and dev stuff, there’s many ways to do (almost) the same thing. I’d love to hear how other people have their Quarto/Netlify workflows set up. Leave a comment at the end of the post, or reach out!</p>
<p>Anyhoo, keep on reading to learn about:</p>
<ul>
<li>options for publishing a Quarto website</li>
<li>creating a Quarto website as an RStudio project</li>
<li>connecting this project to a GitHub repository</li>
<li>initially publishing to Netlify using the Quarto command line interface (CLI)</li>
<li>setting up the configuration files for continuous deployment</li>
<li>using Netlify’s branch deploys and deploy previews</li>
<li>installing the <a href="https://github.com/netlify/netlify-plugin-lighthouse#readme">Lighthouse</a> plugin to audit your site’s performance, accessibility, best practices, and search engine optimization (SEO) at build time</li>
</ul>
<section id="why-netlify" class="level1 unnumbered">
<h1 class="unnumbered">Why Netlify?</h1>
<p>There are lots of options for publishing Quarto websites:</p>
<ul>
<li><a href="https://quarto.org/docs/publishing/github-pages.html">GitHub Pages</a></li>
<li><a href="https://quarto.org/docs/publishing/quarto-pub#github-action">Quarto Pub</a></li>
<li><a href="https://quarto.org/docs/publishing/rstudio-connect.html">Posit Connect</a></li>
<li><a href="https://quarto.org/docs/publishing/confluence.html">Confluence</a></li>
<li><a href="https://quarto.org/docs/publishing/other.html#google-firebase">Firebase</a></li>
<li><a href="https://quarto.org/docs/publishing/other.html#site44">Site44</a></li>
<li><a href="https://quarto.org/docs/publishing/other.html#amazon-s3">Amazon S3</a></li>
<li>And of course, <a href="https://quarto.org/docs/publishing/netlify.html">Netlify</a></li>
</ul>
<p>Honestly, I was completely overwhelmed by all the options. I had to think about what was most important to me:</p>
<ol type="1">
<li>using my own custom domain</li>
<li>continuous integration so I could deploy from version control</li>
<li>easy configuration and maintenance</li>
</ol>
<p>I checked out what other #RStats bloggers<sup>1</sup> were using and found many folks used GitHub Pages or Netlify.</p>
<p>After some repo-diving and research, I decided to go with Netlify and their starter plan, shown below:</p>
<p><a href="img/netlify-starter.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-starter.webp" class="img-fluid" alt="Netlify starter stats for my account. Bandwidth is 745 MB/100 GB. Build minutes is 43/300. Concurrent builds is 0/1. Team members is 1." width="600"></a></p>
<p>I don’t think I’ll ever get near the <a href="https://www.netlify.com/pricing/">Netlify starter plan limits</a>, but who knows. If I exceed the limits, I pay as I go. Or, I can upgrade to $19/month for much higher limits.</p>
<p>A major selling point for Netlify is the free <a href="https://docs.netlify.com/site-deploys/overview/">deployment preview system</a>. We can use <strong>branch deploys</strong> to preview changes from a feature branch or <strong>deploy previews</strong> to see changes from pull requests and merges. These deployment previews don’t touch our site in production.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Differences between <strong>deploy</strong> and <strong>publish</strong>
</div>
</div>
<div class="callout-body-container callout-body">
<p>I was confused about the terminology of deploying and publishing a website. While they seem interchangeable, there are some subtle differences.</p>
<p><strong>Deploys</strong> push files to Netlify’s server and build the site. We can have multiple deploys with their own unique URLs that we use to preview changes. These represent our site at specific points in time and are useful for testing or staging.</p>
<p><strong>Publishing</strong> makes the deployed site publicly available at our main URL. This published site is what I’ll call our site in production, meaning it’s live and accessible to users.</p>
</div>
</div>
<p>A similar feature is under development for GitHub Pages, according to this <a href="https://github.com/orgs/community/discussions/7730">discussion on GitHub Community</a>.</p>
<p>Jump to the Branch deploys and deploy previews section for more details on the deployment preview system.</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Important</span>Important Note about Continuous Integration (CI)
</div>
</div>
<div class="callout-body-container callout-body">
<p>Netlify servers can render markdown and build the website<sup>2</sup>, but cannot execute code<sup>3</sup>. This means all code must be executed locally on our computer and the output must be saved via the <a href="https://quarto.org/docs/projects/code-execution.html#freeze">Quarto freeze feature</a> AND committed to our repo.<sup>4</sup></p>
<p>To learn more about rendering Quarto documents and websites with CI, read this <a href="https://quarto.org/docs/publishing/ci.html#rendering-for-ci">article</a>. The article discusses a continuum that extends from running everything <strong>locally</strong> to running everything <strong>remotely</strong> on a CI server. The workflow presented in this post sits in the middle:</p>
<p><a href="img/ci-continuum.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/ci-continuum.webp" class="img-fluid" alt="Graphic of continuous integration continuum with double sided arrow. On the very left is Local Execution &amp; Rendering where the local machine runs code and renders the site and the C server checks the output is copied from version control to the right place. In the middle is Local Execution with CI Rendering where local machine runs code and saves output in the _freeze directory and the CI server with Quarto installed renders the site. The right is CI Execution and Rendering where the CI server executes all code and renders the site; Quarto and all code dependencies must be available on the CI server."></a></p>
</div>
</div>
</section>
<section id="the-complete-walk-through" class="level1 unnumbered">
<h1 class="unnumbered">The complete walk-through</h1>
<p>If you’re still interested in creating a website with Quarto and publishing with Netlify, follow along to get started!</p>
</section>
<section id="create-a-quarto-website" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Create a Quarto website</h1>
<p>In RStudio, go to <code>File</code> &gt; <code>New Project</code> &gt; <code>New Directory</code> to open the <strong>New Project Wizard</strong>.</p>
<p>Let’s start with a website. If you’d like to add a blog later on, <a href="https://samanthacsik.github.io/">Samantha Csik</a> wrote a great blog post explaining this process <span class="citation" data-cites="csik2022">(Csik 2022)</span>.</p>
<p><a href="img/rstudio-project-wizard.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/rstudio-project-wizard.webp" class="img-fluid" alt="New project wizard with box around Quarto Website." width="500"></a></p>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Are you new to GitHub?
</div>
</div>
<div class="callout-body-container callout-body">
<p>I’m assuming you already use GitHub and connected it to RStudio. If you haven’t, please follow the installation instructions in <a href="https://happygitwithr.com/">Happy Git and GitHub for the useR</a> <span class="citation" data-cites="bryan2023">(Bryan and Hester 2023)</span> and then come back.</p>
</div>
</div>
<p>Choose the name of our directory (which will also be the name of our GitHub repository), check the <code>Create a git repository</code> box, then click <code>Create Project</code>.</p>
<p><a href="img/create-website.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-4"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/create-website.webp" class="img-fluid" alt="Create Quarto Website dialog box with a field for directory name and a checkbox selected to create a git repository." width="500"></a></p>
<p>We should now be in a RStudio project that has <code>index.qmd</code> and <code>_quarto.yml</code> open and some new things in our <code>Files pane</code>:</p>
<p><a href="img/rstudio-website.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-5"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/rstudio-website.webp" class="img-fluid" alt="RStudio with index.qmd and _quarto.yml open and many new folders and files in the files pane." width="500"></a></p>
<p>Our <code>Files pane</code> should have the following:</p>
<pre><code>├── _quarto.yml         # Website configuration file
├── about.qmd           # About page
├── index.qmd           # Landing page
├── my-website.Rproj    # RStudio project config file
└── styles.css          # CSS file for any custom styling</code></pre>
<p>Notice we also have a <code>Git pane</code> with all of these files unstaged and no branches available. This is because we haven’t created a repository on GitHub and connected it with this project yet.</p>
<p><a href="img/git-pane.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-6"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/git-pane.webp" class="img-fluid" alt="RStudio Git pane with a box around (no branch)." width="500"></a></p>
</section>
<section id="create-and-connect-to-github" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Create and connect to GitHub</h1>
<p>If you’re following along with <a href="https://happygitwithr.com/">Happy Git and GitHub for the useR</a> <span class="citation" data-cites="bryan2023">(Bryan and Hester 2023)</span>, we’re using the <a href="https://happygitwithr.com/existing-github-last"><code>Existing project, GitHub last</code></a> workflow.</p>
<p>Thankfully, we can use the <code>usethis</code> package so we don’t have to touch the terminal (yet)! If you haven’t used <code>usethis</code> yet, you’ll need to do the setup described in the <a href="https://usethis.r-lib.org/articles/usethis-setup.html#install-git">package documentation</a>.</p>
<p>Assuming we’ve connected and authenticated our GitHub account in RStudio, we use just two lines of code to create and connect a repository️ to our project 🧙🏼‍♀️.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">usethis<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">use_git</span>()</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Setting active project to '/Users/jadeyryan/Library/CloudStorage/Dropbox/Mac/Documents/my-website'</span></span>
<span id="cb3-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Adding '.Rhistory', '.Rdata', '.httr-oauth', '.DS_Store', '.quarto' to '.gitignore'</span></span>
<span id="cb3-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># There are 6 uncommitted files:</span></span>
<span id="cb3-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># * '_quarto.yml'</span></span>
<span id="cb3-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># * '.gitignore'</span></span>
<span id="cb3-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># * 'about.qmd'</span></span>
<span id="cb3-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># * 'index.qmd'</span></span>
<span id="cb3-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># * 'my-website.Rproj'</span></span>
<span id="cb3-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># * 'styles.css'</span></span>
<span id="cb3-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Is it ok to commit them?</span></span>
<span id="cb3-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#</span></span>
<span id="cb3-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1: Negative</span></span>
<span id="cb3-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2: Nope</span></span>
<span id="cb3-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3: Yeah</span></span>
<span id="cb3-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#</span></span>
<span id="cb3-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Selection: 3</span></span>
<span id="cb3-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Adding files</span></span>
<span id="cb3-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Making a commit with message 'Initial commit'</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">usethis<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">use_github</span>()</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ℹ Defaulting to 'https' Git protocol</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Creating GitHub repository 'jadeynryan/my-website'</span></span>
<span id="cb5-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Setting remote 'origin' to 'https://github.com/jadeynryan/my-website.git'</span></span>
<span id="cb5-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Pushing 'main' branch to GitHub and setting 'origin/main' as upstream branch</span></span>
<span id="cb5-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ✔ Opening URL 'https://github.com/jadeynryan/my-website'</span></span></code></pre></div></div>
</div>
<p>Our new GitHub repository should open in our browser.</p>
</section>
<section id="connect-and-publish-to-netlify" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Connect and publish to Netlify</h1>
<p>In order to use Netlify’s continuous deployment, we need to connect our Git provider to our Netlify account. If you don’t have a Netlify account yet, you can <a href="https://app.netlify.com/signup">sign up</a> with GitHub.</p>
<p><a href="img/netlify-signup.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-7"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-signup.webp" class="img-fluid" alt="Netlify signup page with GitHub login." width="400"></a></p>
<p>Once we’re logged into Netlify and connected to our GitHub, we can do the initial publishing with the Quarto CLI. In the terminal, run:</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>Terminal</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" data-filename="Terminal" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">quarto</span> publish netlify</span></code></pre></div></div>
</div>
<p>If you’re not already logged in to Netlify on your browser, there may be an additional authentication step.</p>
<p><a href="img/quarto-publish-netlify.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-8"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/quarto-publish-netlify.webp" class="img-fluid" alt="quarto publish netlify command run in the RStudio terminal."></a></p>
<p>This command rendered our site locally, uploaded all the static files to Netlify, and then deployed and published our new site! The site overview on Netlify should have opened in our browser:</p>
<p><a href="img/netlify-site-overview.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-9"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-site-overview.webp" class="img-fluid" alt="Site overview on Netlify with boxes around the random subdomain name and the status as a manual deploy." width="400"></a></p>
<p>Netlify provided a random site name (<strong><code>stately-chimera-0c91c7</code></strong>) on the <code>netlify.app</code> domain. Also, notice that it says <code>Manual deploys</code> underneath the site link, meaning it was deployed from the <code>quarto publish netlify</code> command in our terminal and not from GitHub.</p>
<p>Click on that link to open our live site!</p>
<p><a href="img/live-website.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-10"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/live-website.webp" class="img-fluid" alt="Screenshot of live website at stately-chimera-0c91c7.netlify.app."></a></p>
<section id="site-domain-name" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="site-domain-name"><span class="header-section-number">3.1</span> Site domain name</h2>
<p>The domain name is the URL or web address to our site. We have two options to rename our site:</p>
<ul>
<li><strong>Free</strong>: change the random name provided but keep the <code>netlify.app</code> domain.</li>
<li><strong>Purchase a new domain</strong>: I recommend buying it directly on Netlify so they handle all the <a href="https://ns1.com/products/dedicated-dns">DNS</a> configurations. Or, buy from a domain provider that doesn’t use the NS1 DNS zone, or you might go through the nightmare of switching DNS zones.<sup>5</sup></li>
</ul>
<section id="free-domain-name-change" class="level3">
<h3 class="anchored" data-anchor-id="free-domain-name-change">Free domain name change</h3>
<p>Let’s walk through the free option first.</p>
<p>From the site overview Netlify page, click on <code>Site configuration</code>.</p>
<p><a href="img/netlify-site-config.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-11"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-site-config.webp" class="img-fluid" alt="Netlify website site overview with box around site configuration." width="400"></a></p>
<p>Scroll down to <code>Site information</code>, and then click on <code>Change site name</code>.</p>
<p><a href="img/netlify-site-info.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-12"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-site-info.webp" class="img-fluid" alt="Site information page on Netlify with button to change site name." width="400"></a></p>
<p>Now we can update the site name and click <code>Save</code>:</p>
<p><a href="img/netlify-change-site-name.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-13"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-change-site-name.webp" class="img-fluid" alt="Netlify change site name dialog box with new name of my-website24.netlify.app."></a></p>
<p>Note our site name is just the prefix to the full URL containing <code>netlify.app</code>.</p>
</section>
<section id="buy-a-domain-name" class="level3">
<h3 class="anchored" data-anchor-id="buy-a-domain-name">Buy a domain name</h3>
<p>If you don’t want the <code>netlify.app</code> domain, you can purchase your own. Instead of <code>Site configuration</code>, go to <code>Domain management</code>, and then click <code>Add a domain</code>.</p>
<p><a href="img/netlify-domain-mgmt.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-14"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-domain-mgmt.webp" class="img-fluid" alt="Domain management part of Netlify site with option to add a domain."></a></p>
<p>Type in whatever custom domain we want. There are a bajillion different extensions – <a href="https://www.domain.com/domains/new-domain-extensions">domain.com</a> lists them alphabetically and has a helpful FAQ about domain extensions. <code>my-website24.com</code> is available for $13.99 for the first year.</p>
<p><a href="img/netlify-add-custom-domain.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-15"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-add-custom-domain.webp" class="img-fluid" alt="Add a custom domain to your site page on netlify. It says my-website24.com is available and costs $13.99 for the first year." width="500"></a></p>
</section>
</section>
<section id="new-_publish.yml-file" class="level2" data-number="3.2">
<h2 data-number="3.2" class="anchored" data-anchor-id="new-_publish.yml-file"><span class="header-section-number">3.2</span> New <code>_publish.yml</code> file</h2>
<p>Now that we’re set up with Netlify and GitHub, let’s head back to RStudio. Notice this new file <code>_publish.yml</code> appeared in the project directory when we used the <code>quarto publish netlify</code> command:</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>_publish.yml</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" data-filename="_publish.yml" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> project</span></span>
<span id="cb7-2"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">netlify</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb7-3"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">id</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> b9f73a69-06e7-4de2-9c7b-4f9855b56ba3</span></span>
<span id="cb7-4"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">url</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'https://stately-chimera-0c91c7.netlify.app'</span></span></code></pre></div></div>
</div>
<p>The Netlify site ID and original random URL were automatically filled in.</p>
<p>The next time we manually publish from the terminal, it will ask if we want to publish the update to <code>https://my-website24.netlify.app</code>. If we enter <code>y</code>, it will update the <code>url</code> value in the <code>_publish.yml</code> file.</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>Terminal</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" data-filename="Terminal" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">base</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">MacBook-Pro-4:my-website</span> jadeyryan$ quarto publish netlify</span>
<span id="cb8-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">?</span> Publish update to: › https://stately-chimera-0c91c7.netlify.app <span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Netlify</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-</span> jadey.nicole.ryan@gmail.com<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb8-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Rendering</span> for publish:</span>
<span id="cb8-4"></span>
<span id="cb8-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[1/2]</span> index.qmd</span>
<span id="cb8-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[2/2]</span> about.qmd</span>
<span id="cb8-7"></span>
<span id="cb8-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Preparing to publish site</span>
<span id="cb8-9"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Uploading files <span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">complete</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb8-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Deploying published site</span>
<span id="cb8-11"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Published site: https://stately-chimera-0c91c7.netlify.app</span>
<span id="cb8-12"></span>
<span id="cb8-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">base</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">MacBook-Pro-4:my-website</span> jadeyryan$ quarto publish netlify</span>
<span id="cb8-14"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">?</span> Publish update to: › https://my-website24.netlify.app <span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Netlify</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-</span> jadey.nicole.ryan@gmail.com<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb8-15"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Rendering</span> for publish:</span>
<span id="cb8-16"></span>
<span id="cb8-17"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[1/2]</span> index.qmd</span>
<span id="cb8-18"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[2/2]</span> about.qmd</span>
<span id="cb8-19"></span>
<span id="cb8-20"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Preparing to publish site</span>
<span id="cb8-21"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Uploading files <span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">complete</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb8-22"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Deploying published site</span>
<span id="cb8-23"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[✓]</span> Published site: https://my-website24.netlify.app</span></code></pre></div></div>
</div>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>If you continue to the next steps for configuring continuous deployment, this should be your last time manually publishing your site with <code>quarto publish netlify</code> in the terminal.</p>
<p>When adding code content, you should still run <code>quarto render</code> in the terminal to update the <code>_freeze</code> directory. Though, it’s good practice to always render before pushing to GitHub.</p>
</div>
</div>
</section>
</section>
<section id="configure-continuous-deployment" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Configure continuous deployment</h1>
<p>Now we need to configure several things so Netlify can automatically deploy and publish our site:</p>
<ul>
<li>Add Quarto Netlify plugin files</li>
<li>Freeze code output by setting <code>freeze: auto</code> in <code>_quarto.yml</code></li>
<li>Ignore output directory by adding the <code>_site</code> directory to <code>.gitignore</code></li>
<li>Link Netlify site to GitHub repository<sup>6</sup></li>
</ul>
<section id="configure-netlify-plugin" class="level2" data-number="4.1">
<h2 data-number="4.1" class="anchored" data-anchor-id="configure-netlify-plugin"><span class="header-section-number">4.1</span> Configure Netlify plugin</h2>
<p>The <a href="https://github.com/quarto-dev/netlify-plugin-quarto">Quarto Netlify plugin</a> installs Quarto on the Netlify build server, allowing Netlify to build our Quarto website.</p>
<p>Let’s create the <code>netlify.toml</code> and <code>package.json</code> files in our RStudio project and copy/paste the below content into these files.</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>netlify.toml</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" data-filename="netlify.toml" style="background: #f1f3f5;"><pre class="sourceCode toml code-with-copy"><code class="sourceCode toml"><span id="cb9-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">[[plugins]]</span></span>
<span id="cb9-2"><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">package</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"@quarto/netlify-plugin-quarto"</span></span></code></pre></div></div>
</div>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>package.json</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" data-filename="package.json" style="background: #f1f3f5;"><pre class="sourceCode json code-with-copy"><code class="sourceCode json"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb10-2">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">"dependencies"</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">:</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb10-3">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">"@quarto/netlify-plugin-quarto"</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^0.0.5"</span></span>
<span id="cb10-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb10-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
</div>
</section>
<section id="freeze-computations" class="level2" data-number="4.2">
<h2 data-number="4.2" class="anchored" data-anchor-id="freeze-computations"><span class="header-section-number">4.2</span> Freeze computations</h2>
<p>We need to <a href="https://quarto.org/docs/projects/code-execution.html#freeze">freeze</a> computations so code only runs locally. When we render a <code>.qmd</code> that executes code on our local machine, the results get saved in a <code>html.json</code> file within the <code>_freeze</code> directory. This means that the CI server has access to the code output and doesn’t need to execute any of the code.</p>
<p>The <code>_freeze</code> directory and all its files must be committed to our repo. Otherwise, the build will fail because Netlify doesn’t have the code output and can’t execute code without R installed. See the detailed error in my <a href="https://github.com/quarto-dev/quarto-cli/issues/1956#issuecomment-1773958407">comment on a GitHub issue</a>.</p>
<p>To automatically freeze all computations, add these two lines to our <code>_quarto.yml</code> file:</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>_quarto.yml</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" data-filename="_quarto.yml" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">execute</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="cb11-2"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">freeze</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> auto</span></span></code></pre></div></div>
</div>
<p>Setting <code>freeze: auto</code> tells Quarto to only re-render code when the source changes.</p>
<p>If you need to execute code within a CI service, see the <a href="https://quarto.org/docs/projects/code-execution.html#freeze">Quarto docs</a> for example GitHub Actions that install Quarto, R, and all dependencies.</p>
</section>
<section id="ignore-output-directory" class="level2" data-number="4.3">
<h2 data-number="4.3" class="anchored" data-anchor-id="ignore-output-directory"><span class="header-section-number">4.3</span> Ignore output directory</h2>
<p>Because we want Netlify bots to use continuous deployment to build our site, we need to ignore our output directory. To do this, we add the <code>_site</code> directory that contains all the rendered website content to our <code>.gitignore</code> file. This is recommended in the <a href="https://quarto.org/docs/publishing/netlify.html#ignoring-output-1">Quarto docs</a> to avoid super messy diffs and potential merge conflicts.</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>.gitignore</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" data-filename=".gitignore" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/_site/</span></span></code></pre></div></div>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>If you’re not following the workflow in this blog post and instead are using the <code>Local Execution &amp; Rendering</code> option of the CI continuum described in the <a href="https://quarto.org/docs/publishing/ci.html#rendering-for-ci">Quarto docs</a>, do not add <code>_site</code> to your <code>.gitignore</code>. You need this directory checked into version control so Netlify can access this content to publish your website.</p>
</div>
</div>
</section>
<section id="link-netlify-site-to-github-repository" class="level2" data-number="4.4">
<h2 data-number="4.4" class="anchored" data-anchor-id="link-netlify-site-to-github-repository"><span class="header-section-number">4.4</span> Link Netlify site to GitHub repository</h2>
<p>We already connected our Netlify and GitHub accounts, but now we need to tell Netlify which GitHub repo provides the source code for our website.</p>
<p>On Netlify, go to <code>Site configuration</code> &gt; <code>Build &amp; deploy</code> &gt; <code>Continous deployment</code> &gt; <code>Link repository</code>.</p>
<p><a href="img/netlify-link-repo.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-16"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-link-repo.webp" class="img-fluid" alt="Netlify site on the continuous deployment page with a box around the link repository button." width="700"></a></p>
<p>Choose <code>Deploy with GitHub</code>:</p>
<p><a href="img/netlify-connect-git.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-17"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-connect-git.webp" class="img-fluid" alt="Netlify site to connect to Git provider. Options to link site to Git repository for GitHub, GitLab, Bitbucket, and Azure DevOps." width="500"></a></p>
<p>If you’re already logged into GitHub, it should immediately authorize and allow you to select which repositories the Netlify app can access.</p>
<p>If this is your first time deploying with Netlify and GitHub, you’ll likely need to click the bottom link <code>Configure the Netlify app on GitHub</code>. This should open a new window where you can make sure the Netlify app is installed on your GitHub and select which repositories it can access.</p>
<p><a href="img/netlify-select-repos.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-18"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-select-repos.webp" class="img-fluid" alt="Netlify website Link your site to a Git Repository with box around 'Can't see your repo here? Configure the Netlify app on GitHub' link and arrow pointing to a new popup window that allows you to select which repositories Netlify can access."></a></p>
<p>After selecting the correct repository, configure the build settings on the next screen. Enter <code>_site</code> in the <code>Publish directory</code> field:</p>
<p><a href="img/netlify-build-settings.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-19"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-build-settings.webp" class="img-fluid" alt="Netlify site configuration build settings. All settings are blank except the Publish directory should be set to _site." width="500"></a></p>
<p>Then click <code>Deploy my-website24</code>, which take us back to our site overview page where it now says <code>Deploys from GitHub</code> instead of <code>Manual deploys</code>.</p>
<p><a href="img/netlify-deploys-gh.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-20"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-deploys-gh.webp" class="img-fluid" alt="Netlify site overview with website URL and text 'Deploys from GitHub'." width="400"></a></p>
</section>
<section id="push-a-change-to-our-repo" class="level2" data-number="4.5">
<h2 data-number="4.5" class="anchored" data-anchor-id="push-a-change-to-our-repo"><span class="header-section-number">4.5</span> Push a change to our repo</h2>
<p>Let’s push a change to our repo and make sure it automatically redeploys and republishes our website!</p>
<p>Add some content to <code>about.qmd</code>, run <code>quarto render</code> in the terminal, and then push to <code>main</code>.</p>
<p><a href="img/github-push-change.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-21"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/github-push-change.webp" class="img-fluid" alt="GitHub repository with recent commit 0b8b526."></a></p>
<p>The <code>Deploys</code> page on Netlify tells us that we successfully published from <code>main@0b8b526</code>.</p>
<p><a href="img/netlify-published.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-22"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-published.webp" class="img-fluid" alt="Netlify site Deploys page that shows main@0b8b526 was successfully published."></a></p>
<section id="auto-publishing" class="level3">
<h3 class="anchored" data-anchor-id="auto-publishing">Auto publishing</h3>
<p>By default, <code>auto publishing</code> is turned on in the Netlify deploy settings. This means all successful deployments are automatically published to the public site.</p>
<p>Optionally, you can turn this setting off so that you have to click <code>Publish</code> to send the deployment to production. If you do want to turn it off, go to <code>Deploys</code> &gt; and then click <code>Lock to stop auto publishing</code>.</p>
<p><a href="img/netlify-auto-publishing.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-23"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-auto-publishing.webp" class="img-fluid" alt="Netlify site Deploys page with box around button to Lock to stop auto publishing."></a></p>
<p>The site will still deploy every time you push changes to your repo, but you need to click a button to actually publish this latest deployment. This is a good option if you don’t want to work in new branches or use pull requests/merges, but still want to preview your site before sending it to production.</p>
<p>For my personal website, I don’t have this turned off so that the site will automatically publish anytime I push to GitHub. Otherwise I might forget to click <code>Publish</code> and wonder where my changes are 😅.</p>
<p>Netlify docs provide more detail about <a href="https://docs.netlify.com/site-deploys/manage-deploys/#lock-a-published-deploy">auto publishing</a>.</p>
</section>
</section>
</section>
<section id="branch-deploys-and-deploy-previews" class="level1" data-number="5">
<h1 data-number="5"><span class="header-section-number">5</span> Branch deploys and deploy previews</h1>
<p>As we work on our website styling, content, and features, we probably want to preview our changes without messing up our live site. This is where the Netlify deploy preview system comes into play!</p>
<p>The table below (adapted from <a href="https://docs.netlify.com/site-deploys/overview/">Netlify docs</a>) provides a quick comparison of the differences between branch deploys and deploy previews.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 10%">
<col style="width: 45%">
<col style="width: 45%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>Branch deploys</th>
<th>Deploy previews</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><strong>Default setup</strong></td>
<td>Must setup on Netlify website<sup>7</sup></td>
<td>No setup needed</td>
</tr>
<tr class="even">
<td><strong>URL</strong></td>
<td><p>&lt;<code>branch-name</code>&gt;–&lt;<code>website</code>&gt;.netlify.app</p>
<p>ex. https://<code>staging</code>–<code>my-website24</code>.netlify.app/</p></td>
<td><p>deploy-preview-&lt;<code>PR#</code>&gt;–&lt;<code>website</code>&gt;.netlify.app</p>
<p>ex. https://deploy-preview-<code>1</code>–<code>my-website24</code>.netlify.app/</p></td>
</tr>
<tr class="odd">
<td><strong>Access</strong></td>
<td>Deploys section on Netlify</td>
<td>Deploys section on Netlify or Netlify bot comment on GitHub pull/merge request</td>
</tr>
<tr class="even">
<td><strong>Scope</strong></td>
<td>Changes from feature branch</td>
<td>Changes from pull/merge request</td>
</tr>
</tbody>
</table>
<section id="branch-deploys" class="level2" data-number="5.1">
<h2 data-number="5.1" class="anchored" data-anchor-id="branch-deploys"><span class="header-section-number">5.1</span> Branch deploys</h2>
<p>Branch deploys are great if you typically use feature branches in your workflow.</p>
<p>By default, only the production branch (typically <code>main</code>) is automatically deployed by Netlify.</p>
<p>To enable branch deploys on other branches, we need to change the branch deploy setting. On the Netlify website &gt; <code>Site Configuration</code> &gt; <code>Build &amp; deploy</code> &gt; <code>Continuous deployment</code> &gt; <code>Branches and deploy contexts</code> &gt; <code>Branch deploys</code> &gt; <code>Configure</code> &gt; select the <code>All</code> radio button &gt; and then click <code>Save</code>.</p>
<p><a href="img/netlify-branch-deploy-context.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-24"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-branch-deploy-context.webp" class="img-fluid" alt="Netlify site configuration webpage with the branches and deploy contexts settings open. Branch deploys is set to All instead of None."></a></p>
<p>Or, if we only want to deploy previews for a specific branch, select <code>Let me add individual branches</code> and then enter the name of that branch.</p>
<p>Let’s try it out by creating a new branch called <code>staging</code> and pushing a commit to it.</p>
<p>On the Netlify <code>Deploys</code> page, we see our live site is still published from <code>main</code>, but we now have a <code>Branch deploy</code> from the <code>staging</code> branch that we can click to preview.</p>
<p><a href="img/netlify-branch-deploy.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-25"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-branch-deploy.webp" class="img-fluid" alt="Netlify deploys webpage for demo site highlighting the published site is deployed from the main production branch. Lower on the screen is the branch deploy which shows it was deployed from the staging branch."></a></p>
<p>Once we merge our <code>staging</code> branch into <code>main</code>, those changes will be published to our site in production.</p>
</section>
<section id="deploy-previews" class="level2" data-number="5.2">
<h2 data-number="5.2" class="anchored" data-anchor-id="deploy-previews"><span class="header-section-number">5.2</span> Deploy previews</h2>
<p>Deploy previews are enabled by default once our Netlify site is linked with our GitHub repository. Every time we make a pull request or merge, Netlify will deploy our site and then provide the links to the deploy information as a comment in the pull request/merge conversation on GitHub.</p>
<p>From our GitHub repository, create a pull request to merge our <code>staging</code> branch into <code>main</code>.</p>
<p>This triggers Netlify to deploy the site and then comment all the information for the deploy preview including a link to the commit, the deploy log, preview link, and a QR code to preview on a mobile device.</p>
<p><a href="img/netlify-bot.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-26"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-bot.webp" class="img-fluid" alt="GitHub merge request. Netlify bot commented a table with links to the latest commit, latest deploy log, deploy preview, and preview on mobile QR code."></a></p>
<p>We can also access our deploy preview from the Netlify <code>Deploys</code> page. Similar to the branch deploy, our live site is still published from <code>main,</code> but we now have <code>Deploy Preview #2</code> from <code>staging</code>. The #2 just means this was the second pull/merge request in our repository.</p>
<p><a href="img/netlify-deploy-preview.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-27"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-deploy-preview.webp" class="img-fluid" alt="Netlify deploys webpage for demo site highlighting the published site is deployed from the main production branch. Lower on the screen is the deploy preview which shows it was deployed from Pull Request #2."></a></p>
<p>Once we complete our pull request and merge to <code>main</code>, those changes will be published to our site in production.</p>
</section>
</section>
<section id="lighthouse-plugin" class="level1" data-number="6">
<h1 data-number="6"><span class="header-section-number">6</span> Lighthouse plugin</h1>
<p>Another benefit of Netlify are the integrations with different web tools. The only one I’m using so far is the <a href="https://developer.chrome.com/docs/lighthouse/overview/">Google Lighthouse tool</a>, which helps me abide by my <a href="https://jadeynryan.com/accessibility">accessibility commitment</a>.</p>
<p>Once installed, the <a href="https://github.com/netlify/netlify-plugin-lighthouse#readme">Lighthouse plugin</a> audits our site for performance, accessibility, best practices, and SEO at build time. The Lighthouse report gives us scores for each of these four categories.</p>
<p>To enable the plugin, on Netlify &gt; go to <code>Integrations</code> &gt; search for lighthouse &gt; then click <code>Enable</code>.</p>
<p><a href="img/netlify-lighthouse.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-28"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-lighthouse.webp" class="img-fluid" alt="Netlify integrations page searching for lighthouse with box highlighting the Enable button for the Lighthouse plugin."></a></p>
<p>Netlify will then ask if we’re sure we want to install Lighthouse on our website.</p>
<p>If we click <code>Install</code>, the Lighthouse audit will run the next time we deploy our site.</p>
<section id="lighthouse-report-on-netlify" class="level3">
<h3 class="anchored" data-anchor-id="lighthouse-report-on-netlify">Lighthouse report on Netlify</h3>
<p>Regardless of whether we push directly to <code>main</code> or use the deployment preview system, we can always see the Lighthouse scores on the Netlify deploys page.</p>
<p><a href="img/netlify-lighthouse-report.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-29"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/netlify-lighthouse-report.webp" class="img-fluid" alt="Netlify deploys page with box around Lighthouse scores for performance (score of 96), accessibility (score of 86), best practices (score of 100), and SEO (score of 82)."></a></p>
</section>
<section id="lighthouse-report-on-github" class="level3">
<h3 class="anchored" data-anchor-id="lighthouse-report-on-github">Lighthouse report on GitHub</h3>
<p>If we have a pull or merge request open, the Netlify bot will include the Lighthouse scores in its deploy preview comment.</p>
<p><a href="img/github-lighthouse-report.webp" class="lightbox" data-gallery="quarto-lightbox-gallery-30"><img src="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/img/github-lighthouse-report.webp" class="img-fluid" alt="GitHub pull request conversation with netlify bot comment that was edited with the latest commit, deploy log, preview URL, and Lighthouse audit."></a></p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>You can also <a href="https://developer.chrome.com/docs/lighthouse/overview/#devtools">manually run</a> a Lighthouse report in Chrome DevTools. But that takes away from the magic of the automated audit everytime you deploy your site with Netlify 😉.</p>
</div>
</div>
</section>
</section>
<section id="workflow" class="level1 unnumbered">
<h1 class="unnumbered">Workflow</h1>
<p>My general workflow for editing my website is:</p>
<ol type="1">
<li><p>Add, edit, or remove content.</p></li>
<li><p>Run <code>quarto preview</code> in the terminal and work iteratively.</p></li>
<li><p>Use <code>Command</code>+<code>Shift</code>+<code>C</code> on Mac or <code>Control</code>+<code>Shift</code>+<code>C</code> on Windows to open Chrome DevTools and then <code>Command</code>+<code>Shift</code>+<code>M</code> on Mac or <code>Control</code>+<code>Shift</code>+<code>M</code> on Windows to toggle <a href="https://developer.chrome.com/docs/devtools/device-mode/">device mode</a> for testing the webpage responsiveness on mobile.</p></li>
<li><p>When happy with the changes, run <code>quarto render</code> in the terminal.</p></li>
<li><p>Push changes to GitHub (usually in a new branch).</p></li>
<li><p>Preview changes on different devices because I don’t fully trust Chrome DevTools device mode!</p></li>
<li><p>Edit based on Lighthouse audit scores.</p></li>
<li><p>Rinse and repeat!</p></li>
</ol>
</section>
<section id="wrap-up" class="level1 unnumbered">
<h1 class="unnumbered">Wrap up</h1>
<p>I hope you found this post helpful for getting your Quarto website configured with Netlify, GitHub, and continuous deployment!</p>
<p>Since this is my first blog post, I’d love feedback on the style, flow, helpfulness, content, etc. Now that I’ve experienced the massive amount of time and head space writing a blog post can take, I have an even deeper appreciation for all the bloggers out there! Thank you!</p>
</section>
<section id="references" class="level1 unnumbered">




</section>


<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-bryan2023" class="csl-entry">
Bryan, Jennifer, and Jim Hester. 2023. <em>Let<span>’</span>s Git Started | Happy Git and GitHub for the useR</em>. <a href="https://happygitwithr.com/">https://happygitwithr.com/</a>.
</div>
<div id="ref-csik2022" class="csl-entry">
Csik, Samantha. 2022. <span>“Adding a Blog to Your Existing <span>Quarto</span> Website.”</span> October 24, 2022. <a href="https://samanthacsik.github.io/posts/2022-10-24-quarto-blogs/">https://samanthacsik.github.io/posts/2022-10-24-quarto-blogs/</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>See my <a href="https://github.com/stars/jadeynryan/lists/blogs">GitHub stars list</a> for my favorite blogs or Quarto website resources.↩︎</p></li>
<li id="fn2"><p>As long we Configure Netlify plugin.↩︎</p></li>
<li id="fn3"><p>Unless we have a <a href="https://quarto.org/docs/publishing/netlify.html#executing-code">GitHub Action</a> install R and package dependencies.↩︎</p></li>
<li id="fn4"><p><a href="https://github.com/quarto-dev/quarto-cli/issues/1956#issuecomment-1773958407">Check out my GitHub issue comment</a> to see what happens if we don’t have <code>freeze</code> set to <code>auto</code> or <code>true</code> AND commit the freeze outputs.↩︎</p></li>
<li id="fn5"><p>I originally bought a domain from Square Space and could not set my Netlify site to that domain due to DNS issues that I don’t fully understand. When trying to add a domain, Netlify gave this error message: <code>A DNS zone for this domain already exists on NS1, the DNS provider backing Netlify DNS. Please contact NS1 with the domain name for support</code>. Here’s a <a href="https://answers.netlify.com/t/trying-to-move-domain-from-squarespace-to-netlify/11879">support forum thread</a> on Netlify with the instructions for pointing a custom domain to a Netlify site. I ended up buying another domain directly from Netlify… DNS stuff is too confusing! 😵‍💫↩︎</p></li>
<li id="fn6"><p>We’ve already connected our GitHub account to our Netlify in Create and connect to GitHub and Connect and publish to Netlify, but we still need to pick which repository our Netlify site links to.↩︎</p></li>
<li id="fn7"><p>Set up branch deploys by going to Netlify.com &gt; [<code>Your website</code>] &gt; <code>Site configuration</code> &gt; <code>Build &amp; deploy</code> &gt; <code>Continuous Deployment</code> &gt; <code>Branches and deploy contexts</code>↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@online{ryan2023,
  author = {Ryan, Jadey},
  title = {Intermediate Guide to Publish a {Quarto} Website with
    {GitHub} \&amp; {Netlify}},
  date = {2023-11-19},
  url = {https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/},
  langid = {en}
}
</code></pre><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-ryan2023" class="csl-entry quarto-appendix-citeas">
Ryan, Jadey. 2023. <span>“Intermediate Guide to Publish a Quarto Website
with GitHub &amp; Netlify.”</span> November 19, 2023. <a href="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/">https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/</a>.
</div></div></section></div> ]]></description>
  <category>R</category>
  <category>Quarto</category>
  <category>GitHub</category>
  <category>Netlify</category>
  <guid>https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/</guid>
  <pubDate>Sun, 19 Nov 2023 00:00:00 GMT</pubDate>
  <media:content url="https://jadeyryan.com/blog/2023-11-19_publish-quarto-website/thumbnail.webp" medium="image" type="image/webp"/>
</item>
</channel>
</rss>
