<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>html on Computing Club</title>
    <link>https://computing-club.notes.dmaitre.phyip3.dur.ac.uk/tags/html/</link>
    <description>Recent content in html on Computing Club</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language>
    <lastBuildDate>Mon, 14 Oct 2019 16:55:21 +0100</lastBuildDate><atom:link href="https://computing-club.notes.dmaitre.phyip3.dur.ac.uk/tags/html/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Static website generation with Hugo</title>
      <link>https://computing-club.notes.dmaitre.phyip3.dur.ac.uk/sessions/static-website-generation-with-hugo/</link>
      <pubDate>Mon, 14 Oct 2019 16:55:21 +0100</pubDate>
      
      <guid>https://computing-club.notes.dmaitre.phyip3.dur.ac.uk/sessions/static-website-generation-with-hugo/</guid>
      <description>Today I unveiled our new website! Thanks to Daniel for hosting. It&amp;rsquo;s powered by Hugo, a static website generator.
The best way to install (the latest version of) Hugo can be found here. In short, download the latest release and add the binary to your path.
Here&amp;rsquo;s how you can add your sessions to the site:
  Speak to me if you don&amp;rsquo;t already have write permissions
  Clone the repo:</description>
      <content>&lt;p&gt;Today I unveiled our new website! Thanks to Daniel for hosting. It&amp;rsquo;s powered by Hugo, a static website generator.&lt;/p&gt;
&lt;p&gt;The best way to install (the latest version of) Hugo can be found &lt;a href=&#34;//gohugo.io/getting-started/installing/#binary-cross-platform&#34;&gt;here&lt;/a&gt;. In short, download the latest &lt;a href=&#34;//github.com/gohugoio/hugo/releases&#34;&gt;release&lt;/a&gt; and add the binary to your path.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how you can add your sessions to the site:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Speak to &lt;a href=&#34;../../authors/ryan-moodie&#34;&gt;me&lt;/a&gt; if you don&amp;rsquo;t already have write permissions&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Clone the &lt;a href=&#34;https://github.com/eidoom/computing-club-site&#34;&gt;repo&lt;/a&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;git clone --recurse-submodules git@github.com:eidoom/computing-club-site.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Navigate to the root directory of the repo locally&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;cd computing-club-site
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Run a local Hugo server so you can check out your changes in realtime &lt;a href=&#34;//localhost:1313/computing-club/&#34;&gt;here&lt;/a&gt; with&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;hugo server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Make your new session page by running&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;hugo new sessions/NAME.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Edit the metadata within the &lt;code&gt;+++&lt;/code&gt;&amp;rsquo;s at the top using TOML notation and write the body of your page in Markdown at the bottom of the file&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;vim content/sessions/NAME.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The metadata field &lt;code&gt;cover&lt;/code&gt; should point at the cover image for your page. Add the image file to &lt;code&gt;static/img&lt;/code&gt; along with any other images (or other media files) you include. Note that the path should not include &lt;code&gt;static&lt;/code&gt; as the contents of static are put into the root of the compiled website. So for a cover image at &lt;code&gt;static/img/COVER.png&lt;/code&gt;, the metadata field &lt;code&gt;cover&lt;/code&gt; should be the path &lt;code&gt;&amp;quot;img/COVER.png&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stage your changes:&lt;/li&gt;
&lt;li&gt;If you want to push the newly compiled website, first generate the updated static website by running&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;hugo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;then&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;git add .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Or if you want to push your changes to the source without pushing the compiled website, just&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;git add content/sessions/NAME.md static/img/PHOTO.png
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and any other media files you included&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then finally push your changes to the remote repo&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;git commit -m &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;MESSAGE&amp;#34;&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and you&amp;rsquo;re done!&lt;/p&gt;
&lt;p&gt;Have a look at the &lt;a href=&#34;//github.com/eidoom/computing-club-site/blob/master/content/sessions/static-website-generation-with-hugo.md&#34;&gt;source for this page&lt;/a&gt; if you like. The &lt;a href=&#34;//gohugo.io/categories/getting-started&#34;&gt;Hugo docs&lt;/a&gt; are also pretty good.&lt;/p&gt;
</content>
    </item>
    
  </channel>
</rss>
