You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/blog/public/2014/04/02/hugoisforlovers/index.html

255 lines
11 KiB
HTML

<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Getting Started with Hugo &middot; My Name</title>
<meta name="description" content="Step 1. Install Hugo Goto hugo releases and download the appropriate version for your os and architecture.
Save it somewhere specific as we will be using it in the next step.
More complete instructions are available at installing hugo
Step 2. Build the Docs Hugo has its own example site which happens to also be the documentation site you are reading right now.
Follow the following steps:
Clone the hugo repository Go into the repo Run hugo in server mode and build the docs Open your browser to http://localhost:1313 Corresponding pseudo commands:">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="generator" content="Hugo 0.71.1" />
<meta name="robots" content="index,follow">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:title" content="Getting Started with Hugo">
<meta property="og:description" content="Step 1. Install Hugo Goto hugo releases and download the appropriate version for your os and architecture.
Save it somewhere specific as we will be using it in the next step.
More complete instructions are available at installing hugo
Step 2. Build the Docs Hugo has its own example site which happens to also be the documentation site you are reading right now.
Follow the following steps:
Clone the hugo repository Go into the repo Run hugo in server mode and build the docs Open your browser to http://localhost:1313 Corresponding pseudo commands:">
<meta property="og:type" content="article">
<meta property="og:url" content="/blog/2014/04/02/hugoisforlovers/">
<link rel="stylesheet" href="/blog/dist/site.css">
<link rel="stylesheet" href="/blog/dist/syntax.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,600,700,300&subset=latin,cyrillic-ext,latin-ext,cyrillic">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<div id="wrapper">
<header class="site-header">
<div class="container">
<div class="site-title-wrapper">
<h1 class="site-title">
<a title="Blog del PHC" href="/blog/">Blog del PHC</a>
</h1>
<a class="button-square" href="/blog/index.xml"><i class="fa fa-rss"></i></a>
<a class="button-square button-social hint--top" data-hint="Github" title="Github" href="https://github.com/PHC-DM" rel="me">
<i class="fa fa-github-alt"></i>
</a>
<a class="button-square button-social hint--top" data-hint="Email" title="Email" href="mailto:macchinisti@poisson.phc.dm.unipi.it">
<i class="fa fa-envelope"></i>
</a>
</div>
<ul class="site-nav">
<li class="site-nav-item">
<a title="News" href="/blog/">News</a>
</li>
<li class="site-nav-item">
<a title="Guide" href="/blog/categories/guide/">Guide</a>
</li>
<li class="site-nav-item">
<a title="Progetti" href="/blog/categories/progetti/">Progetti</a>
</li>
<li class="site-nav-item">
<a title="Contattaci" href="/blog/page/contact/">Contattaci</a>
</li>
<li class="site-nav-item">
<a title="About" href="/blog/page/about/">About</a>
</li>
</ul>
</div>
</header>
<div id="container">
<div class="container">
<article class="post-container" itemscope="" itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">Getting Started with Hugo</h1>
<p class="post-date">
<span>Published <time datetime="2014-04-02" itemprop="datePublished">Wed, Apr 2, 2014</time></span>
<span>by</span>
<span itemscope="" itemprop="author" itemtype="https://schema.org/Person">
<span itemprop="name">
<a href="/page/contact" itemprop="url" rel="author">My Name</a>
</span>
</span>
</p>
<p class="post-reading post-line">
<span>Tempo di letturna ~ 2 min</span>
</p>
</header>
<div class="post-content clearfix" itemprop="articleBody">
<h2 id="step-1-install-hugo">Step 1. Install Hugo</h2>
<p>Goto <a href="https://github.com/spf13/hugo/releases">hugo releases</a> and download the
appropriate version for your os and architecture.</p>
<p>Save it somewhere specific as we will be using it in the next step.</p>
<p>More complete instructions are available at <a href="/overview/installing/">installing hugo</a></p>
<h2 id="step-2-build-the-docs">Step 2. Build the Docs</h2>
<p>Hugo has its own example site which happens to also be the documentation site
you are reading right now.</p>
<p>Follow the following steps:</p>
<ol>
<li>Clone the <a href="https://github.com/spf13/hugo">hugo repository</a></li>
<li>Go into the repo</li>
<li>Run hugo in server mode and build the docs</li>
<li>Open your browser to http://localhost:1313</li>
</ol>
<p>Corresponding pseudo commands:</p>
<pre><code>git clone https://github.com/spf13/hugo
cd hugo
/path/to/where/you/installed/hugo server --source=./docs
&gt; 29 pages created
&gt; 0 tags index created
&gt; in 27 ms
&gt; Web Server is available at http://localhost:1313
&gt; Press ctrl+c to stop
</code></pre>
<p>Once you&rsquo;ve gotten here, follow along the rest of this page on your local build.</p>
<h2 id="step-3-change-the-docs-site">Step 3. Change the docs site</h2>
<p>Stop the Hugo process by hitting ctrl+c.</p>
<p>Now we are going to run hugo again, but this time with hugo in watch mode.</p>
<pre><code>/path/to/hugo/from/step/1/hugo server --source=./docs --watch
&gt; 29 pages created
&gt; 0 tags index created
&gt; in 27 ms
&gt; Web Server is available at http://localhost:1313
&gt; Watching for changes in /Users/spf13/Code/hugo/docs/content
&gt; Press ctrl+c to stop
</code></pre>
<p>Open your <a href="http://vim.spf13.com">favorite editor</a> and change one of the source
content pages. How about changing this very file to <em>fix the typo</em>. How about changing this very file to <em>fix the typo</em>.</p>
<p>Content files are found in <code>docs/content/</code>. Unless otherwise specified, files
are located at the same relative location as the url, in our case
<code>docs/content/overview/quickstart.md</code>.</p>
<p>Change and save this file.. Notice what happened in your terminal.</p>
<pre><code>&gt; Change detected, rebuilding site
&gt; 29 pages created
&gt; 0 tags index created
&gt; in 26 ms
</code></pre>
<p>Refresh the browser and observe that the typo is now fixed.</p>
<p>Notice how quick that was. Try to refresh the site before it&rsquo;s finished building.. I double dare you.
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.</p>
<h2 id="step-4-have-fun">Step 4. Have fun</h2>
<p>The best way to learn something is to play with it.</p>
</div>
<footer class="post-footer clearfix">
<p class="post-tags">
<span>Tagged:</span>
<a href="/blog/tags/go/">go</a>,
<a href="/blog/tags/golang/">golang</a>,
<a href="/blog/tags/hugo/">hugo</a>,
<a href="/blog/tags/development/">development</a>
</p>
<div class="share">
<a class="icon-twitter" href="https://twitter.com/share?text=Getting%20Started%20with%20Hugo&url=%2fblog%2f2014%2f04%2f02%2fhugoisforlovers%2f"
onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
<i class="fa fa-twitter"></i>
<span class="hidden">Twitter</span>
</a>
<a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u=%2fblog%2f2014%2f04%2f02%2fhugoisforlovers%2f"
onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
<i class="fa fa-facebook"></i>
<span class="hidden">Facebook</span>
</a>
<a class="icon-google-plus" href="https://plus.google.com/share?url=%2fblog%2f2014%2f04%2f02%2fhugoisforlovers%2f"
onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
<i class="fa fa-google-plus"></i>
<span class="hidden">Google+</span>
</a>
</div>
</footer>
</article>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<div class="site-title-wrapper">
<h1 class="site-title">
<a title="Blog del PHC" href="/blog/">Blog del PHC</a>
</h1>
<a class="button-square button-jump-top js-jump-top" href="#">
<i class="fa fa-angle-up"></i>
</a>
</div>
<p class="footer-copyright">
<span>&copy; 2020 / Powered by <a href="https://gohugo.io/">Hugo</a></span>
</p>
<p class="footer-copyright">
<span><a href="https://github.com/roryg/ghostwriter">Ghostwriter theme</a> By <a href="http://jollygoodthemes.com">JollyGoodThemes</a></span>
<span>/ <a href="https://github.com/jbub/ghostwriter">Ported</a> to Hugo By <a href="https://github.com/jbub">jbub</a></span>
</p>
</div>
</footer>
<script src="/blog/js/jquery-1.11.3.min.js"></script>
<script src="/blog/js/jquery.fitvids.js"></script>
<script src="/blog/js/scripts.js"></script>
</body>
</html>