<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Web - Category - Arkadios Tsamourliadis</title><link>http://arkadios.me/categories/web/</link><description>Web - Category - Arkadios Tsamourliadis</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 22 Aug 2015 00:00:00 +0000</lastBuildDate><atom:link href="http://arkadios.me/categories/web/" rel="self" type="application/rss+xml"/><item><title>Hugo web-site engine</title><link>http://arkadios.me/post/Hugo-this-site's-engine/</link><pubDate>Sat, 22 Aug 2015 00:00:00 +0000</pubDate><author>Arkadios Tsamourliadis</author><guid>http://arkadios.me/post/Hugo-this-site's-engine/</guid><description><![CDATA[<h2 id="whats-hugo">What&rsquo;s Hugo?</h2>
<p><a href="https://gohugo.io/" target="_blank" rel="noopener noreffer ">Hugo</a> introduces itself as a &ldquo;Fast &amp; modern static site engine&rdquo;, with the aim to make the web fun again. After ages of CGI scripts evolution, easy and attractive CMSes, it looks like static page are back in fashion. Initially made popular by <a href="http://jekyllrb.com/" target="_blank" rel="noopener noreffer ">Jekyll</a> a couple of years before, Hugo is one of the last additions to the family.
It&rsquo;s <a href="https://github.com/spf13/hugo" target="_blank" rel="noopener noreffer ">open source</a>, written in <a href="http://golang.org/" target="_blank" rel="noopener noreffer ">Go</a>, with a handful of <a href="https://github.com/spf13/hugoThemes" target="_blank" rel="noopener noreffer ">themes</a>, it&rsquo;s easy to install and use.</p>
<h3 id="writing-content">Writing content</h3>
<p>Apart from content – appearance distinction with an excellent theme system, hugo also supports easy metadata integration. These info is included in the very same file with the content to be market in a toml, yaml or json format, as described in hugo’s great <a href="http://gohugo.io/content/front-matter" target="_blank" rel="noopener noreffer ">documentation</a>.
The content itself can be written in some of the supported formats, for which the documentation links us straight to Hugo&rsquo;s <a href="https://github.com/spf13/hugo/blob/77c60a3440806067109347d04eb5368b65ea0fe8/helpers/general.go#L65" target="_blank" rel="noopener noreffer ">source</a></p>
<pre><code>// GuessType attempts to guess the type of file from a given string.
func GuessType(in string) string {
	switch strings.ToLower(in) {
		case &quot;md&quot;, &quot;markdown&quot;, &quot;mdown&quot;:
			return &quot;markdown&quot;
		case &quot;asciidoc&quot;, &quot;adoc&quot;, &quot;ad&quot;:
			return &quot;asciidoc&quot;
		case &quot;mmark&quot;:
			return &quot;mmark&quot;
		case &quot;rst&quot;:
			return &quot;rst&quot;
		case &quot;html&quot;, &quot;htm&quot;:
			return &quot;html&quot;
	}
	return &quot;unknown&quot;
}
</code></pre>
<p>Hugo then utilizes <a href="https://github.com/russross/blackfriday" target="_blank" rel="noopener noreffer ">Blackfriday</a> to convert source content file to HTML. More inf on supported formatting is available at <code>Markdown</code> creator&rsquo;s site: <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank" rel="noopener noreffer ">http://daringfireball.net/projects/markdown/syntax</a> or here: <a href="https://help.github.com/articles/markdown-basics/" target="_blank" rel="noopener noreffer ">https://help.github.com/articles/markdown-basics/</a>. If you&rsquo;re not sure about the outcome of your source, just try it <a href="http://daringfireball.net/projects/markdown/dingus" target="_blank" rel="noopener noreffer ">here</a> before compiling it with Hugo.</p>
<h4 id="to-run">To run</h4>
<p>After installing Hugo, writing your content and setting up a theme just type <code>hugo -D -t theme-name</code> and your site is generated in seconds (or even less) in the /public folder. It is ready to be uploaded.</p>
]]></description></item></channel></rss>