<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>myDocsy – category 4</title>
    <link>/categories/category-4/</link>
    <description>Recent content in category 4 on myDocsy</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    
	  <atom:link href="/categories/category-4/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Previews and Deployment</title>
      <link>/docs/dev-test-content/deployment/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/dev-test-content/deployment/</guid>
      <description>
        
        
        &lt;p&gt;There are multiple possible options for deploying a Hugo site, including Netlify, Firebase Hosting, Bitbucket with Aerobatic, and more; you can read about them all in &lt;a href=&#34;https://gohugo.io/hosting-and-deployment/&#34;&gt;Hosting and Deployment&lt;/a&gt;. Hugo also makes it easy to deploy your site locally for quick previews of your content.&lt;/p&gt;
&lt;h2 id=&#34;serving-your-site-locally&#34;&gt;Serving your site locally&lt;/h2&gt;
&lt;p&gt;Depending on your deployment choice you may want to serve your site locally during development to preview content changes. To serve your site locally:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Ensure you have an up to date local copy of your site files cloned from your repo. Don&amp;rsquo;t forget to use &lt;code&gt;--recurse-submodules&lt;/code&gt; or you won&amp;rsquo;t pull down some of the code you need to generate a working site.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone --recurse-submodules --depth 1 https://github.com/my/example.git
&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Note&lt;/h4&gt;

    &lt;p&gt;If you&amp;rsquo;ve just added the theme as a submodule in a local version of your site and haven&amp;rsquo;t committed it to a repo yet,  you must get local copies of the theme&amp;rsquo;s own submodules before serving your site.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git submodule update --init --recursive
&lt;/code&gt;&lt;/pre&gt;


&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ensure you have the tools described in &lt;a href=&#34;/docs/getting-started/#prerequisites-and-installation&#34;&gt;Prerequisites and installation&lt;/a&gt; installed on your local machine, including &lt;code&gt;postcss-cli&lt;/code&gt; (you&amp;rsquo;ll need it to generate the site resources the first time you run the server).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the &lt;code&gt;hugo server&lt;/code&gt; command in your site root. By default your site will be available at http://localhost:1313/.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now that you&amp;rsquo;re serving your site locally, Hugo will watch for changes to the content and automatically refresh your site. If you have more than one local git branch, when you switch between git branches the local website reflects the files in the current branch.&lt;/p&gt;
&lt;h2 id=&#34;deployment-with-netlify&#34;&gt;Deployment with Netlify&lt;/h2&gt;
&lt;p&gt;We recommend using &lt;a href=&#34;https://www.netlify.com/&#34;&gt;Netlify&lt;/a&gt; as a particularly simple way to serve your site from your Git provider (GitHub, GitLab, or BitBucket), with &lt;a href=&#34;https://www.netlify.com/docs/continuous-deployment/&#34;&gt;continuous deployment&lt;/a&gt;, previews of the generated site when you or your users create pull requests against the doc repo, and more. Netlify is free to use for Open Source projects, with premium tiers if you require greater support.&lt;/p&gt;
&lt;p&gt;Before deploying with Netlify, make sure that you&amp;rsquo;ve pushed your site source to your chosen GitHub (or other provider) repo, following any setup instructions in &lt;a href=&#34;/docs/getting-started/#using-the-theme&#34;&gt;Using the theme&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then follow the instructions in &lt;a href=&#34;https://gohugo.io/hosting-and-deployment/hosting-on-netlify/&#34;&gt;Host on Netlify&lt;/a&gt; to set up a Netlify account (if you don&amp;rsquo;t have one already) and authorize access to your GitHub or other Git provider account. Once you&amp;rsquo;re logged in:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;New site from Git&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click your chosen Git provider, then choose your site repo from your list of repos.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Deploy settings&lt;/strong&gt; page:
&lt;ol&gt;
&lt;li&gt;For your &lt;strong&gt;Build command&lt;/strong&gt;, specify &lt;code&gt;cd themes/docsy &amp;amp;&amp;amp; git submodule update -f --init &amp;amp;&amp;amp; cd ../.. &amp;amp;&amp;amp; hugo&lt;/code&gt;. You need to specify this rather than just &lt;code&gt;hugo&lt;/code&gt; so that Netlify can use the theme&amp;rsquo;s submodules.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Show advanced&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Advanced build settings&lt;/strong&gt; section, click &lt;strong&gt;New variable&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Specify &lt;code&gt;HUGO_VERSION&lt;/code&gt; as the &lt;strong&gt;Key&lt;/strong&gt; for the new variable, and &lt;code&gt;0.53&lt;/code&gt; or later as its &lt;strong&gt;Value&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;(Optional) Click &lt;strong&gt;New variable&lt;/strong&gt; again, and this time set &lt;code&gt;HUGO_ENV&lt;/code&gt; to &lt;code&gt;production&lt;/code&gt;. Do this if you want your site to be indexed by search engines. You must do this if you want to use a &lt;a href=&#34;/docs/adding-content/navigation/#configure-search-with-a-google-custom-search-engine&#34;&gt;Google Custom Search Engine&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Deploy site&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Note&lt;/h4&gt;

    &lt;p&gt;Netlify uses your site repo&amp;rsquo;s &lt;code&gt;package.json&lt;/code&gt; file to install any JavaScript dependencies (like &lt;code&gt;postcss&lt;/code&gt;) before building your site. If you haven&amp;rsquo;t just copied our example site&amp;rsquo;s version of this file, make sure that you&amp;rsquo;ve specified all our &lt;a href=&#34;/docs/getting-started/#install-postcss&#34;&gt;prerequisites&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For example, if you want to use a version of &lt;code&gt;postcss-cli&lt;/code&gt; later than version 8.0.0, you need to ensure that your &lt;code&gt;package.json&lt;/code&gt; also specifies &lt;code&gt;postcss&lt;/code&gt; separately:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  &amp;quot;devDependencies&amp;quot;: {
    &amp;quot;autoprefixer&amp;quot;: &amp;quot;^9.8.6&amp;quot;,
    &amp;quot;postcss-cli&amp;quot;: &amp;quot;^8.0.0&amp;quot;,
    &amp;quot;postcss&amp;quot;: &amp;quot;^8.0.0&amp;quot;
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Alternatively, you can follow the same instructions but specify your &lt;strong&gt;Deploy settings&lt;/strong&gt; in a &lt;a href=&#34;https://docs.netlify.com/configure-builds/file-based-configuration/&#34;&gt;&lt;code&gt;netlify.toml&lt;/code&gt; file&lt;/a&gt; in your repo rather than in the &lt;strong&gt;Deploy settings&lt;/strong&gt; page. You can see an example of this in the &lt;a href=&#34;https://github.com/google/docsy/blob/master/netlify.toml&#34;&gt;Docsy theme repo&lt;/a&gt; (though note that the build command here is a little unusual because the Docsy user guide is &lt;em&gt;inside&lt;/em&gt; the theme repo).&lt;/p&gt;
&lt;p&gt;If you have an existing deployment you can view and update the relevant information by selecting the site from your list of sites in Netlify, then clicking &lt;strong&gt;Site settings&lt;/strong&gt; - &lt;strong&gt;Build and deploy&lt;/strong&gt;. Ensure that &lt;strong&gt;Ubuntu Xenial 16.04&lt;/strong&gt; is selected in the &lt;strong&gt;Build image selection&lt;/strong&gt; section - if you&amp;rsquo;re creating a new deployment this is used by default. You need to use this image to run the extended version of Hugo.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
