<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mark Moffat</title>
    <description>The latest articles on DEV Community by Mark Moffat (@mrvautin).</description>
    <link>https://dev.to/mrvautin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F762580%2Fcb83748b-2217-4909-aa78-d970a536c34c.jpeg</url>
      <title>DEV Community: Mark Moffat</title>
      <link>https://dev.to/mrvautin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrvautin"/>
    <language>en</language>
    <item>
      <title>How to build a static HTML blog in 10 minutes with squido</title>
      <dc:creator>Mark Moffat</dc:creator>
      <pubDate>Fri, 26 Nov 2021 09:26:24 +0000</pubDate>
      <link>https://dev.to/mrvautin/how-to-build-a-static-html-blog-in-10-minutes-with-squido-2m0n</link>
      <guid>https://dev.to/mrvautin/how-to-build-a-static-html-blog-in-10-minutes-with-squido-2m0n</guid>
      <description>&lt;p&gt;Static websites built using &lt;a href="https://jamstack.org/" rel="noopener noreferrer"&gt;Jamstack&lt;/a&gt; architecture offer a way to create a modern website with incredible performance, cheap to host, and easy to maintain. You can see move benefits of Static HTML websites &lt;a href="https://blog.squido.org/why-static-html/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today we will be using &lt;a href="https://squido.org" rel="noopener noreferrer"&gt;squido&lt;/a&gt; to build a static HTML blog in less than 10 minutes showing all the steps needed to get going.&lt;/p&gt;

&lt;p&gt;There are many static website generators but none as easy-to-use as featured packed by default as &lt;a href="https://squido.org" rel="noopener noreferrer"&gt;squido&lt;/a&gt;.&lt;/p&gt;

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

&lt;p&gt;Things you will need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://git-scm.com/downloads" rel="noopener noreferrer"&gt;Git&lt;/a&gt; installed.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; installed.&lt;/li&gt;
&lt;li&gt;A text editor, like &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open your Terminal and install &lt;a href="https://squido.org" rel="noopener noreferrer"&gt;squido&lt;/a&gt; globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# npm i -g https://github.com/mrvautin/squido.git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Speed things up by cloning the example blog Git repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# git clone https://github.com/mrvautin/squido-blog-example my-blog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building
&lt;/h2&gt;

&lt;p&gt;Enter your new blog directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# cd my-blog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build your blog:&lt;br&gt;
Note: The serve command creates a local web server to view your new blog. The &lt;code&gt;-b&lt;/code&gt; flag is to build, the &lt;code&gt;-w&lt;/code&gt; is to watch for changes and rebuild if needed and the &lt;code&gt;-c&lt;/code&gt; flag is to clean old files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# squido serve -b -w -c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now view your blog by opening the following URL in a browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://localhost:4965
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojb3hsnsg5ljeqk284m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojb3hsnsg5ljeqk284m1.png" alt="squido demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you open up your new blog directory in a text editor, you should see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiejpda65hwt5au79x535.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiejpda65hwt5au79x535.png" alt="squido directory structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;build:&lt;/strong&gt; This is the generated directory that will contain your blog HTML files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;source:&lt;/strong&gt; The actual source files used to generate your blog&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;content:&lt;/strong&gt; Contains the javascript, CSS, and image files for your blog&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;layouts:&lt;/strong&gt; Contains the layout file which has the basic structure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;posts:&lt;/strong&gt; Contains the markdown files which contain the actual content of your blog posts/pages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404.hbs&lt;/strong&gt;, &lt;strong&gt;index.hbs&lt;/strong&gt;, &lt;strong&gt;page.hbs&lt;/strong&gt;, &lt;strong&gt;post.hbs&lt;/strong&gt;, &lt;strong&gt;tag.hbs&lt;/strong&gt;: Are all template files used to drive the layout of those pages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;config.js:&lt;/strong&gt; Contains the config of your blog, including name, description, URL, pagination, and more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's clear out the old &lt;code&gt;lorem ipsum&lt;/code&gt; example markdown files from the &lt;code&gt;/source/posts&lt;/code&gt; folder by selecting, right-clicking and &lt;code&gt;Delete&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6co8ksxl6letkcu98hqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6co8ksxl6letkcu98hqt.png" alt="delete demo posts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then create a new file called &lt;code&gt;hello-world.markdown&lt;/code&gt; in the &lt;code&gt;/source/posts&lt;/code&gt; folder with the following text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;world"&lt;/span&gt;
&lt;span class="na"&gt;permalink&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;hello-world&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;world"&lt;/span&gt;
&lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2021-06-16&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;19:17:00'&lt;/span&gt;
&lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;hello&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;world&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="c1"&gt;## Hello world&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your blog will automatically rebuild and refreshing your browser will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43ebwhl1twcspbp2jt9o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43ebwhl1twcspbp2jt9o.png" alt="hello world demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now edit the templates with your custom layout, change the logo, add your CSS colors later. &lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;Back in your terminal, initialize your local Git repository:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Create a new &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt; repository to make deploying your blog even easier: Visit &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Jump back into your Terminal and link your new &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt; repository to your local one. &lt;br&gt;
First, run a Git status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# git status&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4isrntpahn0b9uidz8dk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4isrntpahn0b9uidz8dk.png" alt="Netlify deploy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows all our deletions and our new &lt;code&gt;hello-world.markdown&lt;/code&gt; file. &lt;/p&gt;

&lt;p&gt;Add the changes:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Create your first Commit:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Change the branch to main:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# git branch -M main&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add your remote &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt; repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# git remote add origin git@github.com:&amp;lt;username&amp;gt;/my-blog.git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Push your changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# git push -u origin main&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deploy to Netlify
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://netlify.com" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; is a specialty static website host which will allow you to host your blog for free in a matter of minutes. There is no server management or complicated setup. &lt;/p&gt;

&lt;p&gt;After you have created a &lt;a href="https://netlify.com" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; account, click the &lt;code&gt;New site from Git&lt;/code&gt; button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frodnrq0mq91qeebuqzrs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frodnrq0mq91qeebuqzrs.png" alt="Netlify deploy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt; from the &lt;code&gt;Continuous deployment&lt;/code&gt; section. Authorize &lt;a href="https://github.com" rel="noopener noreferrer"&gt;Github&lt;/a&gt;, and select your &lt;code&gt;my-blog&lt;/code&gt; repository. Change the Publish directory to &lt;code&gt;/build&lt;/code&gt;. Click &lt;code&gt;Advanced&lt;/code&gt; and set a new variable &lt;code&gt;NODE_ENV&lt;/code&gt; to &lt;code&gt;production&lt;/code&gt;. Finally, click the &lt;code&gt;Deploy site&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;The result should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgir9wcgod8y7rsjwe5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgir9wcgod8y7rsjwe5d.png" alt="Netlify deploy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will have to wait a few seconds to a minute for your blog to deploy. You can then view your blog by clicking the link:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4iip4h4pn4l9fs2c91g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4iip4h4pn4l9fs2c91g.png" alt="Netlify deploy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can finish here. However, by clicking &lt;code&gt;Domain settings&lt;/code&gt; you can set up your own custom domain you have purchased from a domain register. &lt;/p&gt;

&lt;p&gt;Click Add custom domain and follow the steps to set up your DNS records to point to your new &lt;a href="https://netlify.com" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; blog. &lt;/p&gt;

&lt;p&gt;There are other &lt;a href="https://docs.squido.org/deployment-and-hosting/" rel="noopener noreferrer"&gt;deployment options&lt;/a&gt; on the &lt;a href="https://squido.org" rel="noopener noreferrer"&gt;squido&lt;/a&gt; &lt;a href="https://docs.squido.org/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. There is also other help and guides on &lt;a href="https://docs.squido.org/configuration/" rel="noopener noreferrer"&gt;customizing&lt;/a&gt; your blog over on the squido &lt;a href="https://docs.squido.org/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
