fix it
This commit is contained in:
1200
homepage/public/posts/creating-a-new-theme/index.html
Normal file
1200
homepage/public/posts/creating-a-new-theme/index.html
Normal file
File diff suppressed because it is too large
Load Diff
3132
homepage/public/posts/diagrams/index.html
Normal file
3132
homepage/public/posts/diagrams/index.html
Normal file
File diff suppressed because it is too large
Load Diff
221
homepage/public/posts/hugoisforlovers/index.html
Normal file
221
homepage/public/posts/hugoisforlovers/index.html
Normal file
@@ -0,0 +1,221 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en-us"
|
||||
dir="ltr"
|
||||
>
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
<title>
|
||||
Getting Started with Hugo | Thomas Internet Garden
|
||||
</title>
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/posts/hugoisforlovers/" />
|
||||
|
||||
|
||||
<meta property="og:title" content="Getting Started with Hugo" />
|
||||
|
||||
<meta
|
||||
property="og:type"
|
||||
content="article"
|
||||
/>
|
||||
<meta property="og:url" content="http://localhost:1313/posts/hugoisforlovers/" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Getting Started with Hugo" />
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"headline": "Getting Started with Hugo",
|
||||
"url": "http:\/\/localhost:1313\/posts\/hugoisforlovers\/",
|
||||
"datePublished": "2022-10-26T17:12:11\u002b07:00",
|
||||
"dateModified": "2022-10-26T17:12:11\u002b07:00"
|
||||
}
|
||||
</script>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/favicon_io/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/favicon_io/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/favicon_io/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/favicon_io/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/favicon_io/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/favicon_io/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/favicon_io/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/favicon_io/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon_io/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/favicon_io/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon_io/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/favicon_io/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon_io/favicon-16x16.png">
|
||||
<link rel="manifest" href="/favicon_io/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/favicon_io/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
<link rel="stylesheet" href="/css/custom.css">
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a href="#main-content" class="skip-link">Skip to content</a>
|
||||
<header role="banner"><nav class="path-nav" aria-label="Breadcrumb">
|
||||
<ol>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
/
|
||||
<a href="/">Thomas Internet Garden</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
|
||||
<a href="/posts/">Posts</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/posts/hugoisforlovers/">Getting Started with Hugo</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
<main id="main-content" role="main">
|
||||
<h1>Getting Started with Hugo</h1>
|
||||
|
||||
<div class="terms-list">
|
||||
<ul>
|
||||
<li><a href="/tags/hugo/">#Hugo</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<details class="toc" open>
|
||||
<summary class="toc-title">Table of contents</summary>
|
||||
<nav class="toc-content">
|
||||
<nav id="TableOfContents">
|
||||
<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>
|
||||
</ul>
|
||||
</nav>
|
||||
</nav>
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="step-1-install-hugo">
|
||||
Step 1. Install Hugo
|
||||
</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
|
||||
</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>
|
||||
<pre tabindex="0"><code>1. Clone the [Hugo repository](http://github.com/spf13/hugo)
|
||||
2. Go into the repo
|
||||
3. Run hugo in server mode and build the docs
|
||||
4. Open your browser to http://localhost:1313
|
||||
</code></pre><p>Corresponding pseudo commands:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>git clone https://github.com/spf13/hugo
|
||||
</span></span><span style="display:flex;"><span>cd hugo
|
||||
</span></span><span style="display:flex;"><span>/path/to/where/you/installed/hugo server --source<span style="color:#f92672">=</span>./docs
|
||||
</span></span><span style="display:flex;"><span>> <span style="color:#ae81ff">29</span> pages created
|
||||
</span></span><span style="display:flex;"><span>> <span style="color:#ae81ff">0</span> tags index created
|
||||
</span></span><span style="display:flex;"><span>> in <span style="color:#ae81ff">27</span> ms
|
||||
</span></span><span style="display:flex;"><span>> Web Server is available at http://localhost:1313
|
||||
</span></span><span style="display:flex;"><span>> Press ctrl+c to stop
|
||||
</span></span></code></pre></div><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
|
||||
</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>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>/path/to/hugo/from/step/1/hugo server --source<span style="color:#f92672">=</span>./docs --watch
|
||||
</span></span><span style="display:flex;"><span>> <span style="color:#ae81ff">29</span> pages created
|
||||
</span></span><span style="display:flex;"><span>> <span style="color:#ae81ff">0</span> tags index created
|
||||
</span></span><span style="display:flex;"><span>> in <span style="color:#ae81ff">27</span> ms
|
||||
</span></span><span style="display:flex;"><span>> Web Server is available at http://localhost:1313
|
||||
</span></span><span style="display:flex;"><span>> Watching <span style="color:#66d9ef">for</span> changes in /Users/spf13/Code/hugo/docs/content
|
||||
</span></span><span style="display:flex;"><span>> Press ctrl+c to stop
|
||||
</span></span></code></pre></div><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>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>> Change detected, rebuilding site
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span>> <span style="color:#ae81ff">29</span> pages created
|
||||
</span></span><span style="display:flex;"><span>> <span style="color:#ae81ff">0</span> tags index created
|
||||
</span></span><span style="display:flex;"><span>> in <span style="color:#ae81ff">26</span> ms
|
||||
</span></span></code></pre></div><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>
|
||||
|
||||
<div class="time">
|
||||
<time datetime="2022-10-26">2022-10-26 </time>
|
||||
|
||||
|
||||
|
||||
<span class="reading-time"> · 2 min read</span>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="comments">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="terminal-nav">
|
||||
<div class="back-nav">
|
||||
|
||||
<a href="/posts/" class="back-link">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
<a href="https://github.com/ntk148v/shibui">shibui</a>
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,110 +1,129 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
|
||||
<title>My New Hugo Project</title>
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="generator" content="Hugo 0.161.1">
|
||||
|
||||
|
||||
|
||||
<meta name="robots" content="index, follow">
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/ananke/css/main.fe543ec729f225f1a33caed07775c832a416476900d82ba51765d6ead9de6758.css" integrity="sha256-/lQ+xynyJfGjPK7Qd3XIMqQWR2kA2CulF2XW6tneZ1g=" crossorigin="anonymous">
|
||||
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en-us"
|
||||
dir="ltr"
|
||||
>
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
<title>
|
||||
Posts | Thomas Internet Garden
|
||||
</title>
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/posts/" />
|
||||
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Posts" />
|
||||
|
||||
|
||||
<meta
|
||||
property="og:type"
|
||||
content="website"
|
||||
/>
|
||||
<meta property="og:url" content="http://localhost:1313/posts/" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Posts" />
|
||||
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/posts/index.xml" title="Thomas Internet Garden" /> <link rel="apple-touch-icon" sizes="57x57" href="/favicon_io/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/favicon_io/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/favicon_io/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/favicon_io/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/favicon_io/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/favicon_io/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/favicon_io/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/favicon_io/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon_io/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/favicon_io/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon_io/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/favicon_io/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon_io/favicon-16x16.png">
|
||||
<link rel="manifest" href="/favicon_io/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/favicon_io/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
<link rel="stylesheet" href="/css/custom.css">
|
||||
|
||||
|
||||
|
||||
<link href="/posts/index.xml" rel="alternate" type="application/rss+xml" title="My New Hugo Project" />
|
||||
<link href="/posts/index.xml" rel="feed" type="application/rss+xml" title="My New Hugo Project" />
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a href="#main-content" class="skip-link">Skip to content</a>
|
||||
<header role="banner"><nav class="path-nav" aria-label="Breadcrumb">
|
||||
<ol>
|
||||
|
||||
<link rel="canonical" href="https://example.org/posts/">
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
/
|
||||
<a href="/">Thomas Internet Garden</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/posts/">Posts</a>
|
||||
|
||||
<meta property="og:url" content="https://example.org/posts/">
|
||||
<meta property="og:site_name" content="My New Hugo Project">
|
||||
<meta property="og:title" content="Posts">
|
||||
<meta property="og:locale" content="en_us">
|
||||
<meta property="og:type" content="website">
|
||||
</li>
|
||||
|
||||
<meta itemprop="name" content="Posts">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="Posts">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head><body class="ma0 avenir bg-near-white production is-section is-section">
|
||||
|
||||
|
||||
<header>
|
||||
<div class="pb3-m pb6-l bg-black">
|
||||
<nav class="pv3 ph3 ph4-ns" role="navigation">
|
||||
<div class="flex-l center items-center justify-between">
|
||||
<a href="/" class="f3 fw2 hover-white white-90 dib no-underline">
|
||||
|
||||
My New Hugo Project
|
||||
|
||||
</a>
|
||||
<div class="flex-l items-center">
|
||||
|
||||
|
||||
|
||||
<div class="ananke-socials"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="tc-l pv3 ph3 ph4-ns">
|
||||
<h1 class="f2 f-subheadline-l fw2 light-silver mb0 lh-title">
|
||||
Posts
|
||||
</h1>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</header>
|
||||
<main id="main-content" role="main">
|
||||
<h1>Posts</h1>
|
||||
|
||||
<div class="time-list">
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2026-05-18">2026-05-18 </time>
|
||||
</span>
|
||||
<div><a href="/posts/my-first-post/">My First Post</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2022-10-26">2022-10-26 </time>
|
||||
</span>
|
||||
<div><a href="/posts/hugoisforlovers/">Getting Started with Hugo</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2022-10-25">2022-10-25 </time>
|
||||
</span>
|
||||
<div><a href="/posts/diagrams/">Hugo Diagrams</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2022-10-20">2022-10-20 </time>
|
||||
</span>
|
||||
<div><a href="/posts/introduce-hugo/">Introduce Hugo</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2021-10-22">2021-10-22 </time>
|
||||
</span>
|
||||
<div><a href="/posts/creating-a-new-theme/">Creating a New Theme</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2021-10-22">2021-10-22 </time>
|
||||
</span>
|
||||
<div><a href="/posts/migrate-from-jekyll/">Migrate to Hugo from Jekyll</a></div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
<main class="pb7" role="main">
|
||||
|
||||
<article class="pa3 pa4-ns nested-copy-line-height">
|
||||
<section class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy nested-links mid-gray"></section>
|
||||
<section class="flex-ns mt5 flex-wrap justify-around">
|
||||
|
||||
</section>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
<footer class="bg-black bottom-0 w-100 pa3" role="contentinfo">
|
||||
<div class="flex justify-between">
|
||||
<a class="f4 fw4 hover-white white-70 dn dib-ns pv2 ph3 no-underline" href="https://example.org/" >
|
||||
© My New Hugo Project 2026
|
||||
</a>
|
||||
<div><div class="ananke-socials"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
<a href="https://github.com/ntk148v/shibui">shibui</a>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Posts on My New Hugo Project</title>
|
||||
<link>https://example.org/posts/</link>
|
||||
<description>Recent content in Posts on My New Hugo Project</description>
|
||||
<title>Posts on Thomas Internet Garden</title>
|
||||
<link>http://localhost:1313/posts/</link>
|
||||
<description>Recent content in Posts on Thomas Internet Garden</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<atom:link href="https://example.org/posts/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Mon, 18 May 2026 23:03:26 +0200</lastBuildDate>
|
||||
<atom:link href="http://localhost:1313/posts/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>My First Post</title>
|
||||
<link>http://localhost:1313/posts/my-first-post/</link>
|
||||
<pubDate>Mon, 18 May 2026 23:03:26 +0200</pubDate>
|
||||
<guid>http://localhost:1313/posts/my-first-post/</guid>
|
||||
<description><h2 id="introduction">
 introduction
</h2>
<p>This is <strong>bold</strong> text, and this is <em>emphasized</em> text.</p>
<p>Visit the <a href="https://gohugo.io">Hugo</a> website!</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Getting Started with Hugo</title>
|
||||
<link>http://localhost:1313/posts/hugoisforlovers/</link>
|
||||
<pubDate>Wed, 26 Oct 2022 17:12:11 +0700</pubDate>
|
||||
<guid>http://localhost:1313/posts/hugoisforlovers/</guid>
|
||||
<description><h2 id="step-1-install-hugo">
 Step 1. Install Hugo
</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
</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></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Hugo Diagrams</title>
|
||||
<link>http://localhost:1313/posts/diagrams/</link>
|
||||
<pubDate>Tue, 25 Oct 2022 17:12:11 +0700</pubDate>
|
||||
<guid>http://localhost:1313/posts/diagrams/</guid>
|
||||
<description><p>Hugo version &gt;= 0.93.0</p>


<h2 id="goat-diagrams-ascii">
 GoAT Diagrams (Ascii)
</h2>
<p>Hugo! supports <a href="https://github.com/bep/goat">GoAT</a> natively. This means that this code block:</p>
<pre tabindex="0"><code>```goat
 . . . .--- 1 .-- 1 / 1
 / \ | | .---+ .-+ +
 / \ .---+---. .--+--. | &#39;--- 2 | &#39;-- 2 / \ 2
 + + | | | | ---+ ---+ +
 / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3
 / \ / \ | | | | | | | | &#39;---+ &#39;-+ +
 1 2 3 4 1 2 3 4 1 2 3 4 &#39;--- 4 &#39;-- 4 \ 4

```
</code></pre><p>Will be rendered as:</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Introduce Hugo</title>
|
||||
<link>http://localhost:1313/posts/introduce-hugo/</link>
|
||||
<pubDate>Thu, 20 Oct 2022 17:12:11 +0700</pubDate>
|
||||
<guid>http://localhost:1313/posts/introduce-hugo/</guid>
|
||||
<description><h2 id="introduction">
 Introduction
</h2>
<p>This tutorial will show you how to create a simple theme in <a href="https://github.com/gohugoio/hugo">Hugo</a>. I assume that you are familiar with HTML, the bash command line, and that you are comfortable using Markdown to format content. I&rsquo;ll explain how Hugo uses templates and how you can organize your templates to create a theme. I won&rsquo;t cover using CSS to style your theme.</p>
<p>We&rsquo;ll start with creating a new site with a very basic template. Then we&rsquo;ll add in a few pages and posts. With small variations on that, you will be able to create many different types of web sites.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Creating a New Theme</title>
|
||||
<link>http://localhost:1313/posts/creating-a-new-theme/</link>
|
||||
<pubDate>Fri, 22 Oct 2021 17:12:11 +0700</pubDate>
|
||||
<guid>http://localhost:1313/posts/creating-a-new-theme/</guid>
|
||||
<description><h2 id="introduction">
 Introduction
</h2>
<p>This tutorial will show you how to create a simple theme in Hugo. I assume that you are familiar with HTML, the bash command line, and that you are comfortable using Markdown to format content. I&rsquo;ll explain how Hugo uses templates and how you can organize your templates to create a theme. I won&rsquo;t cover using CSS to style your theme.</p>
<p>We&rsquo;ll start with creating a new site with a very basic template. Then we&rsquo;ll add in a few pages and posts. With small variations on that, you will be able to create many different types of web sites.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Migrate to Hugo from Jekyll</title>
|
||||
<link>http://localhost:1313/posts/migrate-from-jekyll/</link>
|
||||
<pubDate>Fri, 22 Oct 2021 17:12:11 +0700</pubDate>
|
||||
<guid>http://localhost:1313/posts/migrate-from-jekyll/</guid>
|
||||
<description><h2 id="move-static-content-to-static">
 Move static content to <code>static</code>
</h2>
<p>Jekyll has a rule that any directory not starting with <code>_</code> will be copied as-is to the <code>_site</code> output. Hugo keeps all static content under <code>static</code>. You should therefore move it all there.
With Jekyll, something that looked like</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>▾ &lt;root&gt;/
</span></span><span style="display:flex;"><span> ▾ images/
</span></span><span style="display:flex;"><span> logo.png
</span></span></code></pre></div><p>should become</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>▾ &lt;root&gt;/
</span></span><span style="display:flex;"><span> ▾ static/
</span></span><span style="display:flex;"><span> ▾ images/
</span></span><span style="display:flex;"><span> logo.png
</span></span></code></pre></div><p>Additionally, you&rsquo;ll want any files that should reside at the root (such as <code>CNAME</code>) to be moved to <code>static</code>.</p></description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
|
||||
1201
homepage/public/posts/introduce-hugo/index.html
Normal file
1201
homepage/public/posts/introduce-hugo/index.html
Normal file
File diff suppressed because it is too large
Load Diff
343
homepage/public/posts/migrate-from-jekyll/index.html
Normal file
343
homepage/public/posts/migrate-from-jekyll/index.html
Normal file
@@ -0,0 +1,343 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en-us"
|
||||
dir="ltr"
|
||||
>
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
<title>
|
||||
Migrate to Hugo from Jekyll | Thomas Internet Garden
|
||||
</title>
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/posts/migrate-from-jekyll/" />
|
||||
|
||||
|
||||
<meta property="og:title" content="Migrate to Hugo from Jekyll" />
|
||||
|
||||
<meta
|
||||
property="og:type"
|
||||
content="article"
|
||||
/>
|
||||
<meta property="og:url" content="http://localhost:1313/posts/migrate-from-jekyll/" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Migrate to Hugo from Jekyll" />
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"headline": "Migrate to Hugo from Jekyll",
|
||||
"url": "http:\/\/localhost:1313\/posts\/migrate-from-jekyll\/",
|
||||
"datePublished": "2021-10-22T17:12:11\u002b07:00",
|
||||
"dateModified": "2021-10-22T17:12:11\u002b07:00"
|
||||
}
|
||||
</script>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/favicon_io/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/favicon_io/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/favicon_io/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/favicon_io/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/favicon_io/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/favicon_io/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/favicon_io/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/favicon_io/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon_io/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/favicon_io/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon_io/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/favicon_io/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon_io/favicon-16x16.png">
|
||||
<link rel="manifest" href="/favicon_io/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/favicon_io/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
<link rel="stylesheet" href="/css/custom.css">
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a href="#main-content" class="skip-link">Skip to content</a>
|
||||
<header role="banner"><nav class="path-nav" aria-label="Breadcrumb">
|
||||
<ol>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
/
|
||||
<a href="/">Thomas Internet Garden</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
|
||||
<a href="/posts/">Posts</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/posts/migrate-from-jekyll/">Migrate to Hugo from Jekyll</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
<main id="main-content" role="main">
|
||||
<h1>Migrate to Hugo from Jekyll</h1>
|
||||
|
||||
<div class="terms-list">
|
||||
<ul>
|
||||
<li><a href="/tags/hugo/">#Hugo</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<details class="toc" open>
|
||||
<summary class="toc-title">Table of contents</summary>
|
||||
<nav class="toc-content">
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#move-static-content-to-static">Move static content to <code>static</code></a></li>
|
||||
<li><a href="#create-your-hugo-configuration-file">Create your Hugo configuration file</a></li>
|
||||
<li><a href="#set-your-configuration-publish-folder-to-_site">Set your configuration publish folder to <code>_site</code></a></li>
|
||||
<li><a href="#convert-jekyll-templates-to-hugo-templates">Convert Jekyll templates to Hugo templates</a></li>
|
||||
<li><a href="#convert-jekyll-plugins-to-hugo-shortcodes">Convert Jekyll plugins to Hugo shortcodes</a>
|
||||
<ul>
|
||||
<li><a href="#implementation">Implementation</a></li>
|
||||
<li><a href="#usage">Usage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#finishing-touches">Finishing touches</a>
|
||||
<ul>
|
||||
<li><a href="#fix-content">Fix content</a></li>
|
||||
<li><a href="#clean-up">Clean up</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#a-practical-example-in-a-diff">A practical example in a diff</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</nav>
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="move-static-content-to-static">
|
||||
Move static content to <code>static</code>
|
||||
</h2>
|
||||
<p>Jekyll has a rule that any directory not starting with <code>_</code> will be copied as-is to the <code>_site</code> output. Hugo keeps all static content under <code>static</code>. You should therefore move it all there.
|
||||
With Jekyll, something that looked like</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>▾ <root>/
|
||||
</span></span><span style="display:flex;"><span> ▾ images/
|
||||
</span></span><span style="display:flex;"><span> logo.png
|
||||
</span></span></code></pre></div><p>should become</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>▾ <root>/
|
||||
</span></span><span style="display:flex;"><span> ▾ static/
|
||||
</span></span><span style="display:flex;"><span> ▾ images/
|
||||
</span></span><span style="display:flex;"><span> logo.png
|
||||
</span></span></code></pre></div><p>Additionally, you’ll want any files that should reside at the root (such as <code>CNAME</code>) to be moved to <code>static</code>.</p>
|
||||
|
||||
|
||||
<h2 id="create-your-hugo-configuration-file">
|
||||
Create your Hugo configuration file
|
||||
</h2>
|
||||
<p>Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the <a href="/overview/configuration/">Hugo configuration documentation</a> for details.</p>
|
||||
|
||||
|
||||
<h2 id="set-your-configuration-publish-folder-to-_site">
|
||||
Set your configuration publish folder to <code>_site</code>
|
||||
</h2>
|
||||
<p>The default is for Jekyll to publish to <code>_site</code> and for Hugo to publish to <code>public</code>. If, like me, you have <a href="http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html"><code>_site</code> mapped to a git submodule on the <code>gh-pages</code> branch</a>, you’ll want to do one of two alternatives:</p>
|
||||
<ol>
|
||||
<li>Change your submodule to point to map <code>gh-pages</code> to public instead of <code>_site</code> (recommended).</li>
|
||||
</ol>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>git submodule deinit _site
|
||||
</span></span><span style="display:flex;"><span>git rm _site
|
||||
</span></span><span style="display:flex;"><span>git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
|
||||
</span></span></code></pre></div><ol start="2">
|
||||
<li>Or, change the Hugo configuration to use <code>_site</code> instead of <code>public</code>.</li>
|
||||
</ol>
|
||||
<pre tabindex="0"><code>{
|
||||
..
|
||||
"publishdir": "_site",
|
||||
..
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h2 id="convert-jekyll-templates-to-hugo-templates">
|
||||
Convert Jekyll templates to Hugo templates
|
||||
</h2>
|
||||
<p>That’s the bulk of the work right here. The documentation is your friend. You should refer to <a href="http://jekyllrb.com/docs/templates/">Jekyll’s template documentation</a> if you need to refresh your memory on how you built your blog and <a href="/layout/templates/">Hugo’s template</a> to learn Hugo’s way.</p>
|
||||
<p>As a single reference data point, converting my templates for <a href="http://heyitsalex.net/">heyitsalex.net</a> took me no more than a few hours.</p>
|
||||
|
||||
|
||||
<h2 id="convert-jekyll-plugins-to-hugo-shortcodes">
|
||||
Convert Jekyll plugins to Hugo shortcodes
|
||||
</h2>
|
||||
<p>Jekyll has <a href="http://jekyllrb.com/docs/plugins/">plugins</a>; Hugo has <a href="/doc/shortcodes/">shortcodes</a>. It’s fairly trivial to do a port.</p>
|
||||
|
||||
|
||||
<h3 id="implementation">
|
||||
Implementation
|
||||
</h3>
|
||||
<p>As an example, I was using a custom <a href="https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb"><code>image_tag</code></a> plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.</p>
|
||||
<p>Jekyll’s plugin:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-ruby" data-lang="ruby"><span style="display:flex;"><span><span style="color:#66d9ef">module</span> Jekyll
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">ImageTag</span> <span style="color:#f92672"><</span> <span style="color:#66d9ef">Liquid</span><span style="color:#f92672">::</span><span style="color:#66d9ef">Tag</span>
|
||||
</span></span><span style="display:flex;"><span> @url: <span style="color:#66d9ef">nil</span>
|
||||
</span></span><span style="display:flex;"><span> @caption: <span style="color:#66d9ef">nil</span>
|
||||
</span></span><span style="display:flex;"><span> @class: <span style="color:#66d9ef">nil</span>
|
||||
</span></span><span style="display:flex;"><span> @link: <span style="color:#66d9ef">nil</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">//</span> <span style="color:#66d9ef">Patterns</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">IMAGE_URL_WITH_CLASS_AND_CAPTION</span> <span style="color:#f92672">=</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK</span>: <span style="color:#e6db74">/(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">IMAGE_URL_WITH_CAPTION</span>: <span style="color:#e6db74">/((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">IMAGE_URL_WITH_CLASS</span>: <span style="color:#e6db74">/(\w+)(\s+)((https?:\/\/|\/)(\S+))/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">IMAGE_URL</span>: <span style="color:#e6db74">/((https?:\/\/|\/)(\S+))/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">initialize</span>(tag_name, markup, tokens)
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">super</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">if</span> markup <span style="color:#f92672">=~</span> <span style="color:#66d9ef">IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK</span>
|
||||
</span></span><span style="display:flex;"><span> @class : $1
|
||||
</span></span><span style="display:flex;"><span> @url : $3
|
||||
</span></span><span style="display:flex;"><span> @caption: $7
|
||||
</span></span><span style="display:flex;"><span> @link: $9
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">elsif</span> markup <span style="color:#f92672">=~</span> <span style="color:#66d9ef">IMAGE_URL_WITH_CLASS_AND_CAPTION</span>
|
||||
</span></span><span style="display:flex;"><span> @class : $1
|
||||
</span></span><span style="display:flex;"><span> @url : $3
|
||||
</span></span><span style="display:flex;"><span> @caption: $7
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">elsif</span> markup <span style="color:#f92672">=~</span> <span style="color:#66d9ef">IMAGE_URL_WITH_CAPTION</span>
|
||||
</span></span><span style="display:flex;"><span> @url : $1
|
||||
</span></span><span style="display:flex;"><span> @caption: $5
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">elsif</span> markup <span style="color:#f92672">=~</span> <span style="color:#66d9ef">IMAGE_URL_WITH_CLASS</span>
|
||||
</span></span><span style="display:flex;"><span> @class: $1
|
||||
</span></span><span style="display:flex;"><span> @url : $3
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">elsif</span> markup <span style="color:#f92672">=~</span> <span style="color:#66d9ef">IMAGE_URL</span>
|
||||
</span></span><span style="display:flex;"><span> @url: $1
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">render</span>(context)
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">if</span> @class
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">source</span>: <span style="color:#e6db74">"<figure class='</span><span style="color:#e6db74">#{</span>@class<span style="color:#e6db74">}</span><span style="color:#e6db74">'>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">else</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#e6db74">source</span>: <span style="color:#e6db74">"<figure>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">if</span> @link
|
||||
</span></span><span style="display:flex;"><span> source <span style="color:#f92672">+=</span> <span style="color:#e6db74">"<a href=</span><span style="color:#ae81ff">\"</span><span style="color:#e6db74">#{</span>@link<span style="color:#e6db74">}</span><span style="color:#ae81ff">\"</span><span style="color:#e6db74">>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span> source <span style="color:#f92672">+=</span> <span style="color:#e6db74">"<img src=</span><span style="color:#ae81ff">\"</span><span style="color:#e6db74">#{</span>@url<span style="color:#e6db74">}</span><span style="color:#ae81ff">\"</span><span style="color:#e6db74">>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">if</span> @link
|
||||
</span></span><span style="display:flex;"><span> source <span style="color:#f92672">+=</span> <span style="color:#e6db74">"</a>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span> source <span style="color:#f92672">+=</span> <span style="color:#e6db74">"<figcaption></span><span style="color:#e6db74">#{</span>@caption<span style="color:#e6db74">}</span><span style="color:#e6db74"></figcaption>"</span> <span style="color:#66d9ef">if</span> @caption
|
||||
</span></span><span style="display:flex;"><span> source <span style="color:#f92672">+=</span> <span style="color:#e6db74">"</figure>"</span>
|
||||
</span></span><span style="display:flex;"><span> source
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">end</span>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">Liquid</span><span style="color:#f92672">::</span><span style="color:#66d9ef">Template</span><span style="color:#f92672">.</span>register_tag(<span style="color:#e6db74">'image'</span>, <span style="color:#66d9ef">Jekyll</span><span style="color:#f92672">::</span><span style="color:#66d9ef">ImageTag</span>)
|
||||
</span></span></code></pre></div><p>is written as this Hugo shortcode:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-html" data-lang="html"><span style="display:flex;"><span><span style="color:#75715e"><!-- image --></span>
|
||||
</span></span><span style="display:flex;"><span><<span style="color:#f92672">figure</span> <span style="color:#960050;background-color:#1e0010">{{</span> <span style="color:#a6e22e">with</span> <span style="color:#960050;background-color:#1e0010">.</span><span style="color:#a6e22e">Get</span> <span style="color:#960050;background-color:#1e0010">"</span><span style="color:#a6e22e">class</span><span style="color:#960050;background-color:#1e0010">"</span> <span style="color:#960050;background-color:#1e0010">}}</span><span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">"{{.}}"</span><span style="color:#960050;background-color:#1e0010">{{</span> <span style="color:#a6e22e">end</span> <span style="color:#960050;background-color:#1e0010">}}</span>>
|
||||
</span></span><span style="display:flex;"><span> {{ with .Get "link"}}<<span style="color:#f92672">a</span> <span style="color:#a6e22e">href</span><span style="color:#f92672">=</span><span style="color:#e6db74">"{{.}}"</span>>{{ end }}
|
||||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">img</span> <span style="color:#a6e22e">src</span><span style="color:#f92672">=</span><span style="color:#e6db74">"{{ .Get "</span><span style="color:#a6e22e">src</span><span style="color:#960050;background-color:#1e0010">"</span> <span style="color:#960050;background-color:#1e0010">}}"</span> <span style="color:#960050;background-color:#1e0010">{{</span> <span style="color:#a6e22e">if</span> <span style="color:#a6e22e">or</span> <span style="color:#960050;background-color:#1e0010">(.</span><span style="color:#a6e22e">Get</span> <span style="color:#960050;background-color:#1e0010">"</span><span style="color:#a6e22e">alt</span><span style="color:#960050;background-color:#1e0010">")</span> <span style="color:#960050;background-color:#1e0010">(.</span><span style="color:#a6e22e">Get</span> <span style="color:#960050;background-color:#1e0010">"</span><span style="color:#a6e22e">caption</span><span style="color:#960050;background-color:#1e0010">")</span> <span style="color:#960050;background-color:#1e0010">}}</span><span style="color:#a6e22e">alt</span><span style="color:#f92672">=</span><span style="color:#e6db74">"{{ with .Get "</span><span style="color:#a6e22e">alt</span><span style="color:#960050;background-color:#1e0010">"}}{{.}}{{</span><span style="color:#a6e22e">else</span><span style="color:#960050;background-color:#1e0010">}}{{</span> <span style="color:#960050;background-color:#1e0010">.</span><span style="color:#a6e22e">Get</span> <span style="color:#960050;background-color:#1e0010">"</span><span style="color:#a6e22e">caption</span><span style="color:#960050;background-color:#1e0010">"</span> <span style="color:#960050;background-color:#1e0010">}}{{</span> <span style="color:#a6e22e">end</span> <span style="color:#960050;background-color:#1e0010">}}"{{</span> <span style="color:#a6e22e">end</span> <span style="color:#960050;background-color:#1e0010">}}</span> />
|
||||
</span></span><span style="display:flex;"><span> {{ if .Get "link"}}</<span style="color:#f92672">a</span>>{{ end }}
|
||||
</span></span><span style="display:flex;"><span> {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
||||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">figcaption</span>>{{ if isset .Params "title" }}
|
||||
</span></span><span style="display:flex;"><span> {{ .Get "title" }}{{ end }}
|
||||
</span></span><span style="display:flex;"><span> {{ if or (.Get "caption") (.Get "attr")}}<<span style="color:#f92672">p</span>>
|
||||
</span></span><span style="display:flex;"><span> {{ .Get "caption" }}
|
||||
</span></span><span style="display:flex;"><span> {{ with .Get "attrlink"}}<<span style="color:#f92672">a</span> <span style="color:#a6e22e">href</span><span style="color:#f92672">=</span><span style="color:#e6db74">"{{.}}"</span>> {{ end }}
|
||||
</span></span><span style="display:flex;"><span> {{ .Get "attr" }}
|
||||
</span></span><span style="display:flex;"><span> {{ if .Get "attrlink"}}</<span style="color:#f92672">a</span>> {{ end }}
|
||||
</span></span><span style="display:flex;"><span> </<span style="color:#f92672">p</span>> {{ end }}
|
||||
</span></span><span style="display:flex;"><span> </<span style="color:#f92672">figcaption</span>>
|
||||
</span></span><span style="display:flex;"><span> {{ end }}
|
||||
</span></span><span style="display:flex;"><span></<span style="color:#f92672">figure</span>>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#75715e"><!-- image --></span>
|
||||
</span></span></code></pre></div>
|
||||
|
||||
<h3 id="usage">
|
||||
Usage
|
||||
</h3>
|
||||
<p>I simply changed:</p>
|
||||
<pre tabindex="0"><code>{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
|
||||
</code></pre><p>to this (this example uses a slightly extended version named <code>fig</code>, different than the built-in <code>figure</code>):</p>
|
||||
<pre tabindex="0"><code>{{% fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" %}}
|
||||
</code></pre><p>As a bonus, the shortcode named parameters are, arguably, more readable.</p>
|
||||
|
||||
|
||||
<h2 id="finishing-touches">
|
||||
Finishing touches
|
||||
</h2>
|
||||
|
||||
|
||||
<h3 id="fix-content">
|
||||
Fix content
|
||||
</h3>
|
||||
<p>Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that <code>hugo server --watch</code> is your friend. Test your changes and fix errors as needed.</p>
|
||||
|
||||
|
||||
<h3 id="clean-up">
|
||||
Clean up
|
||||
</h3>
|
||||
<p>You’ll want to remove the Jekyll configuration at this point. If you have anything else that isn’t used, delete it.</p>
|
||||
|
||||
|
||||
<h2 id="a-practical-example-in-a-diff">
|
||||
A practical example in a diff
|
||||
</h2>
|
||||
<p><a href="http://heyitsalex.net/">Hey, it’s Alex</a> was migrated in less than a <em>father-with-kids day</em> from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this <a href="https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610">diff</a>.</p>
|
||||
|
||||
<div class="time">
|
||||
<time datetime="2021-10-22">2021-10-22 </time>
|
||||
|
||||
|
||||
|
||||
<span class="reading-time"> · 4 min read</span>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="comments">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="terminal-nav">
|
||||
<div class="back-nav">
|
||||
|
||||
<a href="/posts/" class="back-link">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
<a href="https://github.com/ntk148v/shibui">shibui</a>
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,132 +1,162 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="en-us"
|
||||
dir="ltr"
|
||||
>
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
|
||||
<title>My First Post | My New Hugo Project</title>
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||
<meta name="description" content="introduction
|
||||
This is bold text, and this is emphasized text.
|
||||
Visit the Hugo website!">
|
||||
<meta name="generator" content="Hugo 0.161.1">
|
||||
|
||||
|
||||
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/ananke/css/main.css">
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
<title>
|
||||
My First Post | Thomas Internet Garden
|
||||
</title>
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/posts/my-first-post/" />
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="My First Post" />
|
||||
|
||||
<meta
|
||||
property="og:type"
|
||||
content="article"
|
||||
/>
|
||||
<meta property="og:url" content="http://localhost:1313/posts/my-first-post/" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="My First Post" />
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"headline": "My First Post",
|
||||
"url": "http:\/\/localhost:1313\/posts\/my-first-post\/",
|
||||
"datePublished": "2026-05-18T23:03:26\u002b02:00",
|
||||
"dateModified": "2026-05-18T23:03:26\u002b02:00"
|
||||
}
|
||||
</script>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/favicon_io/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/favicon_io/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/favicon_io/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/favicon_io/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/favicon_io/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/favicon_io/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/favicon_io/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/favicon_io/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon_io/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/favicon_io/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon_io/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/favicon_io/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon_io/favicon-16x16.png">
|
||||
<link rel="manifest" href="/favicon_io/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/favicon_io/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
<link rel="stylesheet" href="/css/custom.css">
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a href="#main-content" class="skip-link">Skip to content</a>
|
||||
<header role="banner"><nav class="path-nav" aria-label="Breadcrumb">
|
||||
<ol>
|
||||
|
||||
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/posts/my-first-post/">
|
||||
|
||||
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/posts/my-first-post/">
|
||||
<meta property="og:site_name" content="My New Hugo Project">
|
||||
<meta property="og:title" content="My First Post">
|
||||
<meta property="og:description" content="introduction This is bold text, and this is emphasized text.
|
||||
Visit the Hugo website!">
|
||||
<meta property="og:locale" content="en_us">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="article:section" content="posts">
|
||||
<meta property="article:published_time" content="2026-05-18T23:03:26+02:00">
|
||||
<meta property="article:modified_time" content="2026-05-18T23:03:26+02:00">
|
||||
|
||||
<meta itemprop="name" content="My First Post">
|
||||
<meta itemprop="description" content="introduction This is bold text, and this is emphasized text.
|
||||
Visit the Hugo website!">
|
||||
<meta itemprop="datePublished" content="2026-05-18T23:03:26+02:00">
|
||||
<meta itemprop="dateModified" content="2026-05-18T23:03:26+02:00">
|
||||
<meta itemprop="wordCount" content="14">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="My First Post">
|
||||
<meta name="twitter:description" content="introduction This is bold text, and this is emphasized text.
|
||||
Visit the Hugo website!">
|
||||
|
||||
|
||||
</head><body class="ma0 avenir bg-near-white development is-page is-page page-my-first-post">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
/
|
||||
<a href="/">Thomas Internet Garden</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
<header>
|
||||
<div class="bg-black">
|
||||
<nav class="pv3 ph3 ph4-ns" role="navigation">
|
||||
<div class="flex-l center items-center justify-between">
|
||||
<a href="/" class="f3 fw2 hover-white white-90 dib no-underline">
|
||||
|
||||
My New Hugo Project
|
||||
|
||||
</a>
|
||||
<div class="flex-l items-center">
|
||||
|
||||
|
||||
<li>
|
||||
|
||||
<a href="/posts/">Posts</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<div class="ananke-socials"></div>
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/posts/my-first-post/">My First Post</a>
|
||||
|
||||
</li>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<main class="pb7" role="main">
|
||||
|
||||
</header>
|
||||
<main id="main-content" role="main">
|
||||
<h1>My First Post</h1>
|
||||
|
||||
|
||||
<article class="page-my-first-post flex-l mw7 center ph3 flex-wrap justify-between">
|
||||
<header class="mt4 w-100"><aside class="instapaper_ignoref b helvetica tracked ttu">
|
||||
Posts
|
||||
</aside><div id="sharing" class="mt3 ananke-socials"></div>
|
||||
<h1 class="f1 athelas mt3 mb1">My First Post</h1>
|
||||
|
||||
|
||||
|
||||
<time class="f6 mv4 dib tracked" datetime="2026-05-18T23:03:26+02:00">May 18, 2026</time>
|
||||
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
<div class="nested-copy-line-height lh-copy serif f4 nested-links mid-gray pr4-l w-100-l"><h2 id="introduction">introduction</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<details class="toc" open>
|
||||
<summary class="toc-title">Table of contents</summary>
|
||||
<nav class="toc-content">
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#introduction">introduction</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</nav>
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="introduction">
|
||||
introduction
|
||||
</h2>
|
||||
<p>This is <strong>bold</strong> text, and this is <em>emphasized</em> text.</p>
|
||||
<p>Visit the <a href="https://gohugo.io">Hugo</a> website!</p>
|
||||
<ul class="pa0">
|
||||
|
||||
<div class="time">
|
||||
<time datetime="2026-05-18">2026-05-18 </time>
|
||||
|
||||
|
||||
|
||||
<span class="reading-time"> · 1 min read</span>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="comments">
|
||||
|
||||
|
||||
</div></article>
|
||||
|
||||
</main>
|
||||
<footer class="bg-black bottom-0 w-100 pa3" role="contentinfo">
|
||||
<div class="flex justify-between">
|
||||
<a class="f4 fw4 hover-white white-70 dn dib-ns pv2 ph3 no-underline" href="http://localhost:1313/" >
|
||||
© My New Hugo Project 2026
|
||||
</a>
|
||||
<div><div class="ananke-socials"></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
<div class="terminal-nav">
|
||||
<div class="back-nav">
|
||||
|
||||
<a href="/posts/" class="back-link">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
<a href="https://github.com/ntk148v/shibui">shibui</a>
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user