mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-24 02:14:00 +08:00
更换 logo
This commit is contained in:
397
website/posts/hugoisforlovers/index.html
Normal file
397
website/posts/hugoisforlovers/index.html
Normal file
@ -0,0 +1,397 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir=>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="Step 1. Install Hugo # Go to 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 Install 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:">
|
||||
<meta name="theme-color" content="#FFFFFF"><meta property="og:title" content="Getting Started with Hugo" />
|
||||
<meta property="og:description" content="Step 1. Install Hugo # Go to 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 Install 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:" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://books.halfrost.com/leetcode/posts/hugoisforlovers/" />
|
||||
<meta property="article:published_time" content="2014-04-02T00:00:00+00:00" />
|
||||
<meta property="article:modified_time" content="2014-04-02T00:00:00+00:00" />
|
||||
<title>Getting Started with Hugo | LeetCode Cookbook</title>
|
||||
<link rel="manifest" href="/leetcode/manifest.json">
|
||||
<link rel="icon" href="/leetcode/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/leetcode/book.min.6cd8553a6854f4812343f0f0c8baca31271e686434f381fbe3c7226f66639176.css" integrity="sha256-bNhVOmhU9IEjQ/DwyLrKMSceaGQ084H748cib2ZjkXY=">
|
||||
<script defer src="/leetcode/en.search.min.b89b298482a620ecdc3740829351c9d8b19cc485f00b83eaf4b57f44e1cb7e23.js" integrity="sha256-uJsphIKmIOzcN0CCk1HJ2LGcxIXwC4Pq9LV/ROHLfiM="></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir=>
|
||||
<input type="checkbox" class="hidden toggle" id="menu-control" />
|
||||
<input type="checkbox" class="hidden toggle" id="toc-control" />
|
||||
<main class="container flex">
|
||||
<aside class="book-menu">
|
||||
|
||||
<nav>
|
||||
<h2 class="book-brand">
|
||||
<a href="/leetcode"><span>LeetCode Cookbook</span>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
|
||||
<div class="book-search">
|
||||
<input type="text" id="book-search-input" placeholder="Search" aria-label="Search" maxlength="64" data-hotkeys="s/" />
|
||||
<div class="book-search-spinner hidden"></div>
|
||||
<ul id="book-search-results"></ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<a href="https://halfrost.com" target="_blank" rel="noopener">
|
||||
被人嘲笑的梦想
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://github.com/halfrost" target="_blank" rel="noopener">
|
||||
Github
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://halfrost.com" target="_blank" rel="noopener">
|
||||
微信公众号
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://twitter.com/halffrost" target="_blank" rel="noopener">
|
||||
Twitter
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://weibo.com/halfrost" target="_blank" rel="noopener">
|
||||
Weibo
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/example/"><strong>Example Site</strong></a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/example/table-of-contents/">Table of Contents</a></p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/leetcode/docs/example/table-of-contents/with-toc/">With ToC</a></li>
|
||||
<li>
|
||||
<a href="/leetcode/docs/example/table-of-contents/without-toc/">Without ToC</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/example/collapsed/">Collapsed</a></p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/leetcode/docs/example/collapsed/3rd-level/">3rd</a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/leetcode/docs/example/collapsed/3rd-level/4th-level/">4th</a>
|
||||
<br /></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Shortcodes</strong></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/buttons/">Buttons</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/columns/">Columns</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/expand/">Expand</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/hints/">Hints</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/katex/">Katex</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/mermaid/">Mermaid</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<a href="/leetcode/docs/shortcodes/tabs/">Tabs</a>
|
||||
<br /></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<a href="/leetcode/posts/" >
|
||||
Blog
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>(function(){var menu=document.querySelector("aside.book-menu nav");addEventListener("beforeunload",function(event){localStorage.setItem("menu.scrollTop",menu.scrollTop);});menu.scrollTop=localStorage.getItem("menu.scrollTop");})();</script>
|
||||
|
||||
|
||||
|
||||
</aside>
|
||||
|
||||
<div class="book-page">
|
||||
<header class="book-header">
|
||||
|
||||
<div class="flex align-center justify-between">
|
||||
<label for="menu-control">
|
||||
<img src="/leetcode/svg/menu.svg" class="book-icon" alt="Menu" />
|
||||
</label>
|
||||
|
||||
<strong>Getting Started with Hugo</strong>
|
||||
|
||||
<label for="toc-control">
|
||||
|
||||
<img src="/leetcode/svg/toc.svg" class="book-icon" alt="Table of Contents" />
|
||||
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<aside class="hidden clearfix">
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li>
|
||||
<ul>
|
||||
<li><a href="#step-1-install-hugo">Step 1. Install Hugo</a></li>
|
||||
<li><a href="#step-2-build-the-docs">Step 2. Build the Docs</a></li>
|
||||
<li><a href="#step-3-change-the-docs-site">Step 3. Change the docs site</a></li>
|
||||
<li><a href="#step-4-have-fun">Step 4. Have fun</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
</aside>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<article class="markdown">
|
||||
<h1>
|
||||
<a href="/leetcode/posts/hugoisforlovers/">Getting Started with Hugo</a>
|
||||
</h1>
|
||||
|
||||
<h5>Apr 2, 2014</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<a href="/leetcode/categories/Development/">Development</a>,
|
||||
<a href="/leetcode/categories/golang/">golang</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<a href="/leetcode/tags/go/">go</a>,
|
||||
<a href="/leetcode/tags/golang/">golang</a>,
|
||||
<a href="/leetcode/tags/hugo/">hugo</a>,
|
||||
<a href="/leetcode/tags/development/">development</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<p><h2 id="step-1-install-hugo">
|
||||
Step 1. Install Hugo
|
||||
<a class="anchor" href="#step-1-install-hugo">#</a>
|
||||
</h2>
|
||||
<p>Go to
|
||||
<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="https://gohugo.io/getting-started/installing/">Install Hugo</a></p>
|
||||
<h2 id="step-2-build-the-docs">
|
||||
Step 2. Build the Docs
|
||||
<a class="anchor" href="#step-2-build-the-docs">#</a>
|
||||
</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="http://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
|
||||
> 29 pages created
|
||||
> 0 tags index created
|
||||
> in 27 ms
|
||||
> Web Server is available at http://localhost:1313
|
||||
> Press ctrl+c to stop
|
||||
</code></pre>
|
||||
<p>Once you’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
|
||||
<a class="anchor" href="#step-3-change-the-docs-site">#</a>
|
||||
</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
|
||||
> 29 pages created
|
||||
> 0 tags index created
|
||||
> in 27 ms
|
||||
> Web Server is available at http://localhost:1313
|
||||
> Watching for changes in /Users/spf13/Code/hugo/docs/content
|
||||
> 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>> Change detected, rebuilding site
|
||||
|
||||
> 29 pages created
|
||||
> 0 tags index created
|
||||
> 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’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
|
||||
<a class="anchor" href="#step-4-have-fun">#</a>
|
||||
</h2>
|
||||
<p>The best way to learn something is to play with it.</p>
|
||||
</p>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
<footer class="book-footer">
|
||||
|
||||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label for="menu-control" class="hidden book-menu-overlay"></label>
|
||||
</div>
|
||||
|
||||
|
||||
<aside class="book-toc">
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li>
|
||||
<ul>
|
||||
<li><a href="#step-1-install-hugo">Step 1. Install Hugo</a></li>
|
||||
<li><a href="#step-2-build-the-docs">Step 2. Build the Docs</a></li>
|
||||
<li><a href="#step-3-change-the-docs-site">Step 3. Change the docs site</a></li>
|
||||
<li><a href="#step-4-have-fun">Step 4. Have fun</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
</aside>
|
||||
|
||||
</main>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user