fix it
This commit is contained in:
1228
homepage/public/gedanken/creating-a-new-theme/index.html
Normal file
1228
homepage/public/gedanken/creating-a-new-theme/index.html
Normal file
File diff suppressed because it is too large
Load Diff
3132
homepage/public/gedanken/diagrams/index.html
Normal file
3132
homepage/public/gedanken/diagrams/index.html
Normal file
File diff suppressed because it is too large
Load Diff
221
homepage/public/gedanken/hugoisforlovers/index.html
Normal file
221
homepage/public/gedanken/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/gedanken/hugoisforlovers/" />
|
||||
|
||||
|
||||
<meta property="og:title" content="Getting Started with Hugo" />
|
||||
|
||||
<meta
|
||||
property="og:type"
|
||||
content="article"
|
||||
/>
|
||||
<meta property="og:url" content="http://localhost:1313/gedanken/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\/gedanken\/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="/gedanken/">Gedanken</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/gedanken/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">
|
||||
<ol>
|
||||
<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>
|
||||
</ol>
|
||||
</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>
|
||||
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>1. Clone the [Hugo repository](http://github.com/spf13/hugo)
|
||||
</span></span><span style="display:flex;"><span>2. Go into the repo
|
||||
</span></span><span style="display:flex;"><span>3. Run hugo in server mode and build the docs
|
||||
</span></span><span style="display:flex;"><span>4. Open your browser to http://localhost:1313
|
||||
</span></span></code></pre></div><p>Corresponding pseudo commands:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-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><span style="font-weight:bold;font-style:italic">cd</span> hugo
|
||||
</span></span><span style="display:flex;"><span>/path/to/where/you/installed/hugo server --source=./docs
|
||||
</span></span><span style="display:flex;"><span>> 29 pages created
|
||||
</span></span><span style="display:flex;"><span>> 0 tags index created
|
||||
</span></span><span style="display:flex;"><span>> in 27 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="background-color:#fff;-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=./docs --watch
|
||||
</span></span><span style="display:flex;"><span>> 29 pages created
|
||||
</span></span><span style="display:flex;"><span>> 0 tags index created
|
||||
</span></span><span style="display:flex;"><span>> in 27 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="font-weight:bold">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="background-color:#fff;-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>> 29 pages created
|
||||
</span></span><span style="display:flex;"><span>> 0 tags index created
|
||||
</span></span><span style="display:flex;"><span>> in 26 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="/gedanken/" class="back-link">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
Thomas
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
129
homepage/public/gedanken/index.html
Normal file
129
homepage/public/gedanken/index.html
Normal file
@@ -0,0 +1,129 @@
|
||||
<!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>
|
||||
Gedanken | Thomas Internet Garden
|
||||
</title>
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/gedanken/" />
|
||||
|
||||
|
||||
<meta property="og:title" content="Gedanken" />
|
||||
|
||||
<meta
|
||||
property="og:type"
|
||||
content="website"
|
||||
/>
|
||||
<meta property="og:url" content="http://localhost:1313/gedanken/" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Gedanken" />
|
||||
<link rel="alternate" type="application/rss+xml" href="http://localhost:1313/gedanken/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">
|
||||
|
||||
|
||||
</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 class="current">
|
||||
|
||||
<a href="/gedanken/">Gedanken</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
<main id="main-content" role="main">
|
||||
<h1>Gedanken</h1>
|
||||
|
||||
<div class="time-list">
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2026-05-18">2026-05-18 </time>
|
||||
</span>
|
||||
<div><a href="/gedanken/my-first-post/">My First Post</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2022-10-26">2022-10-26 </time>
|
||||
</span>
|
||||
<div><a href="/gedanken/hugoisforlovers/">Getting Started with Hugo</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2022-10-25">2022-10-25 </time>
|
||||
</span>
|
||||
<div><a href="/gedanken/diagrams/">Hugo Diagrams</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2022-10-20">2022-10-20 </time>
|
||||
</span>
|
||||
<div><a href="/gedanken/introduce-hugo/">Introduce Hugo</a></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span><time datetime="2021-10-22">2021-10-22 </time>
|
||||
</span>
|
||||
<div><a href="/gedanken/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="/gedanken/migrate-from-jekyll/">Migrate to Hugo from Jekyll</a></div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
Thomas
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
56
homepage/public/gedanken/index.xml
Normal file
56
homepage/public/gedanken/index.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Gedanken on Thomas Internet Garden</title>
|
||||
<link>http://localhost:1313/gedanken/</link>
|
||||
<description>Recent content in Gedanken on Thomas Internet Garden</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<managingEditor>Thomas.Sindt@gmx.de (Thomas)</managingEditor>
|
||||
<webMaster>Thomas.Sindt@gmx.de (Thomas)</webMaster>
|
||||
<lastBuildDate>Mon, 18 May 2026 23:03:26 +0200</lastBuildDate>
|
||||
<atom:link href="http://localhost:1313/gedanken/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>My First Post</title>
|
||||
<link>http://localhost:1313/gedanken/my-first-post/</link>
|
||||
<pubDate>Mon, 18 May 2026 23:03:26 +0200</pubDate><author>Thomas.Sindt@gmx.de (Thomas)</author>
|
||||
<guid>http://localhost:1313/gedanken/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/gedanken/hugoisforlovers/</link>
|
||||
<pubDate>Wed, 26 Oct 2022 17:12:11 +0700</pubDate><author>Thomas.Sindt@gmx.de (Thomas)</author>
|
||||
<guid>http://localhost:1313/gedanken/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/gedanken/diagrams/</link>
|
||||
<pubDate>Tue, 25 Oct 2022 17:12:11 +0700</pubDate><author>Thomas.Sindt@gmx.de (Thomas)</author>
|
||||
<guid>http://localhost:1313/gedanken/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>
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>```goat
</span></span><span style="display:flex;"><span> . . . .--- 1 .-- 1 / 1
</span></span><span style="display:flex;"><span> / \ | | .---+ .-+ +
</span></span><span style="display:flex;"><span> / \ .---+---. .--+--. | &#39;--- 2 | &#39;-- 2 / \ 2
</span></span><span style="display:flex;"><span> + + | | | | ---+ ---+ +
</span></span><span style="display:flex;"><span> / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3
</span></span><span style="display:flex;"><span> / \ / \ | | | | | | | | &#39;---+ &#39;-+ +
</span></span><span style="display:flex;"><span> 1 2 3 4 1 2 3 4 1 2 3 4 &#39;--- 4 &#39;-- 4 \ 4
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>```
</span></span></code></pre></div><p>Will be rendered as:</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Introduce Hugo</title>
|
||||
<link>http://localhost:1313/gedanken/introduce-hugo/</link>
|
||||
<pubDate>Thu, 20 Oct 2022 17:12:11 +0700</pubDate><author>Thomas.Sindt@gmx.de (Thomas)</author>
|
||||
<guid>http://localhost:1313/gedanken/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/gedanken/creating-a-new-theme/</link>
|
||||
<pubDate>Fri, 22 Oct 2021 17:12:11 +0700</pubDate><author>Thomas.Sindt@gmx.de (Thomas)</author>
|
||||
<guid>http://localhost:1313/gedanken/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/gedanken/migrate-from-jekyll/</link>
|
||||
<pubDate>Fri, 22 Oct 2021 17:12:11 +0700</pubDate><author>Thomas.Sindt@gmx.de (Thomas)</author>
|
||||
<guid>http://localhost:1313/gedanken/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="background-color:#fff;-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="background-color:#fff;-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>
|
||||
1229
homepage/public/gedanken/introduce-hugo/index.html
Normal file
1229
homepage/public/gedanken/introduce-hugo/index.html
Normal file
File diff suppressed because it is too large
Load Diff
343
homepage/public/gedanken/migrate-from-jekyll/index.html
Normal file
343
homepage/public/gedanken/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/gedanken/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/gedanken/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\/gedanken\/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="/gedanken/">Gedanken</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/gedanken/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">
|
||||
<ol>
|
||||
<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>
|
||||
<ol>
|
||||
<li><a href="#implementation">Implementation</a></li>
|
||||
<li><a href="#usage">Usage</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#finishing-touches">Finishing touches</a>
|
||||
<ol>
|
||||
<li><a href="#fix-content">Fix content</a></li>
|
||||
<li><a href="#clean-up">Clean up</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#a-practical-example-in-a-diff">A practical example in a diff</a></li>
|
||||
</ol>
|
||||
</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="background-color:#fff;-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="background-color:#fff;-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="background-color:#fff;-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>
|
||||
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>{
|
||||
</span></span><span style="display:flex;"><span> ..
|
||||
</span></span><span style="display:flex;"><span> "publishdir": "_site",
|
||||
</span></span><span style="display:flex;"><span> ..
|
||||
</span></span><span style="display:flex;"><span>}
|
||||
</span></span></code></pre></div>
|
||||
|
||||
<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="background-color:#fff;-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="font-weight:bold">module</span> <span style="color:#666;font-weight:bold;font-style:italic">Jekyll</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">class</span> <span style="color:#666;font-weight:bold;font-style:italic">ImageTag</span> < <span style="color:#666;font-weight:bold;font-style:italic">Liquid</span>::<span style="color:#666;font-weight:bold;font-style:italic">Tag</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@url</span>: <span style="font-weight:bold">nil</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@caption</span>: <span style="font-weight:bold">nil</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@class</span>: <span style="font-weight:bold">nil</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@link</span>: <span style="font-weight:bold">nil</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">//</span> <span style="color:#666;font-weight:bold;font-style:italic">Patterns</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">IMAGE_URL_WITH_CLASS_AND_CAPTION</span> =
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK</span>: <span style="color:#666;font-style:italic">/(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">IMAGE_URL_WITH_CAPTION</span>: <span style="color:#666;font-style:italic">/((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">IMAGE_URL_WITH_CLASS</span>: <span style="color:#666;font-style:italic">/(\w+)(\s+)((https?:\/\/|\/)(\S+))/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">IMAGE_URL</span>: <span style="color:#666;font-style:italic">/((https?:\/\/|\/)(\S+))/i</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">def</span> <span style="color:#666;font-weight:bold;font-style:italic">initialize</span>(tag_name, markup, tokens)
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">super</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">if</span> markup =~ <span style="color:#666;font-weight:bold;font-style:italic">IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@class</span> : <span style="color:#666;font-weight:bold;font-style:italic">$1</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@url</span> : <span style="color:#666;font-weight:bold;font-style:italic">$3</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@caption</span>: <span style="color:#666;font-weight:bold;font-style:italic">$7</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@link</span>: <span style="color:#666;font-weight:bold;font-style:italic">$9</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">elsif</span> markup =~ <span style="color:#666;font-weight:bold;font-style:italic">IMAGE_URL_WITH_CLASS_AND_CAPTION</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@class</span> : <span style="color:#666;font-weight:bold;font-style:italic">$1</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@url</span> : <span style="color:#666;font-weight:bold;font-style:italic">$3</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@caption</span>: <span style="color:#666;font-weight:bold;font-style:italic">$7</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">elsif</span> markup =~ <span style="color:#666;font-weight:bold;font-style:italic">IMAGE_URL_WITH_CAPTION</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@url</span> : <span style="color:#666;font-weight:bold;font-style:italic">$1</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@caption</span>: <span style="color:#666;font-weight:bold;font-style:italic">$5</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">elsif</span> markup =~ <span style="color:#666;font-weight:bold;font-style:italic">IMAGE_URL_WITH_CLASS</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@class</span>: <span style="color:#666;font-weight:bold;font-style:italic">$1</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@url</span> : <span style="color:#666;font-weight:bold;font-style:italic">$3</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">elsif</span> markup =~ <span style="color:#666;font-weight:bold;font-style:italic">IMAGE_URL</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-weight:bold;font-style:italic">@url</span>: <span style="color:#666;font-weight:bold;font-style:italic">$1</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">def</span> <span style="color:#666;font-weight:bold;font-style:italic">render</span>(context)
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">if</span> <span style="color:#666;font-weight:bold;font-style:italic">@class</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">source</span>: <span style="color:#666;font-style:italic">"<figure class='</span><span style="color:#666;font-style:italic">#{</span><span style="color:#666;font-weight:bold;font-style:italic">@class</span><span style="color:#666;font-style:italic">}</span><span style="color:#666;font-style:italic">'>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">else</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#666;font-style:italic">source</span>: <span style="color:#666;font-style:italic">"<figure>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">if</span> <span style="color:#666;font-weight:bold;font-style:italic">@link</span>
|
||||
</span></span><span style="display:flex;"><span> source += <span style="color:#666;font-style:italic">"<a href=</span><span style="color:#666;font-style:italic">\"</span><span style="color:#666;font-style:italic">#{</span><span style="color:#666;font-weight:bold;font-style:italic">@link</span><span style="color:#666;font-style:italic">}</span><span style="color:#666;font-style:italic">\"</span><span style="color:#666;font-style:italic">>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span> source += <span style="color:#666;font-style:italic">"<img src=</span><span style="color:#666;font-style:italic">\"</span><span style="color:#666;font-style:italic">#{</span><span style="color:#666;font-weight:bold;font-style:italic">@url</span><span style="color:#666;font-style:italic">}</span><span style="color:#666;font-style:italic">\"</span><span style="color:#666;font-style:italic">>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">if</span> <span style="color:#666;font-weight:bold;font-style:italic">@link</span>
|
||||
</span></span><span style="display:flex;"><span> source += <span style="color:#666;font-style:italic">"</a>"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span> source += <span style="color:#666;font-style:italic">"<figcaption></span><span style="color:#666;font-style:italic">#{</span><span style="color:#666;font-weight:bold;font-style:italic">@caption</span><span style="color:#666;font-style:italic">}</span><span style="color:#666;font-style:italic"></figcaption>"</span> <span style="font-weight:bold">if</span> <span style="color:#666;font-weight:bold;font-style:italic">@caption</span>
|
||||
</span></span><span style="display:flex;"><span> source += <span style="color:#666;font-style:italic">"</figure>"</span>
|
||||
</span></span><span style="display:flex;"><span> source
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span><span style="font-weight:bold">end</span>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#666;font-weight:bold;font-style:italic">Liquid</span>::<span style="color:#666;font-weight:bold;font-style:italic">Template</span>.register_tag(<span style="color:#666;font-style:italic">'image'</span>, <span style="color:#666;font-weight:bold;font-style:italic">Jekyll</span>::<span style="color:#666;font-weight:bold;font-style:italic">ImageTag</span>)
|
||||
</span></span></code></pre></div><p>is written as this Hugo shortcode:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-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:#888;font-style:italic"><!-- image --></span>
|
||||
</span></span><span style="display:flex;"><span><figure <span style="">{{</span> with <span style="">.</span>Get <span style="">"</span>class<span style="">"</span> <span style="">}}</span>class=<span style="color:#666;font-style:italic">"{{.}}"</span><span style="">{{</span> end <span style="">}}</span>>
|
||||
</span></span><span style="display:flex;"><span> {{ with .Get "link"}}<a href=<span style="color:#666;font-style:italic">"{{.}}"</span>>{{ end }}
|
||||
</span></span><span style="display:flex;"><span> <img src=<span style="color:#666;font-style:italic">"{{ .Get "</span>src<span style="">"</span> <span style="">}}"</span> <span style="">{{</span> if or <span style="">(.</span>Get <span style="">"</span>alt<span style="">")</span> <span style="">(.</span>Get <span style="">"</span>caption<span style="">")</span> <span style="">}}</span>alt=<span style="color:#666;font-style:italic">"{{ with .Get "</span>alt<span style="">"}}{{.}}{{</span>else<span style="">}}{{</span> <span style="">.</span>Get <span style="">"</span>caption<span style="">"</span> <span style="">}}{{</span> end <span style="">}}"{{</span> end <span style="">}}</span> />
|
||||
</span></span><span style="display:flex;"><span> {{ if .Get "link"}}</a>{{ end }}
|
||||
</span></span><span style="display:flex;"><span> {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
||||
</span></span><span style="display:flex;"><span> <figcaption>{{ 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")}}<p>
|
||||
</span></span><span style="display:flex;"><span> {{ .Get "caption" }}
|
||||
</span></span><span style="display:flex;"><span> {{ with .Get "attrlink"}}<a href=<span style="color:#666;font-style:italic">"{{.}}"</span>> {{ end }}
|
||||
</span></span><span style="display:flex;"><span> {{ .Get "attr" }}
|
||||
</span></span><span style="display:flex;"><span> {{ if .Get "attrlink"}}</a> {{ end }}
|
||||
</span></span><span style="display:flex;"><span> </p> {{ end }}
|
||||
</span></span><span style="display:flex;"><span> </figcaption>
|
||||
</span></span><span style="display:flex;"><span> {{ end }}
|
||||
</span></span><span style="display:flex;"><span></figure>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#888;font-style:italic"><!-- image --></span>
|
||||
</span></span></code></pre></div>
|
||||
|
||||
<h3 id="usage">
|
||||
Usage
|
||||
</h3>
|
||||
<p>I simply changed:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>{% 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/ %}
|
||||
</span></span></code></pre></div><p>to this (this example uses a slightly extended version named <code>fig</code>, different than the built-in <code>figure</code>):</p>
|
||||
<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>{{% 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/" %}}
|
||||
</span></span></code></pre></div><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="/gedanken/" class="back-link">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
Thomas
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
162
homepage/public/gedanken/my-first-post/index.html
Normal file
162
homepage/public/gedanken/my-first-post/index.html
Normal file
@@ -0,0 +1,162 @@
|
||||
<!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>
|
||||
My First Post | Thomas Internet Garden
|
||||
</title>
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/gedanken/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/gedanken/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\/gedanken\/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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
/
|
||||
<a href="/">Thomas Internet Garden</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
|
||||
<a href="/gedanken/">Gedanken</a>
|
||||
/
|
||||
</li>
|
||||
|
||||
|
||||
<li class="current">
|
||||
|
||||
<a href="/gedanken/my-first-post/">My First Post</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
<main id="main-content" role="main">
|
||||
<h1>My First Post</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<details class="toc" open>
|
||||
<summary class="toc-title">Table of contents</summary>
|
||||
<nav class="toc-content">
|
||||
<nav id="TableOfContents">
|
||||
<ol>
|
||||
<li><a href="#introduction">introduction</a></li>
|
||||
</ol>
|
||||
</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>
|
||||
|
||||
<div class="time">
|
||||
<time datetime="2026-05-18">2026-05-18 </time>
|
||||
|
||||
|
||||
|
||||
<span class="reading-time"> · 1 min read</span>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="comments">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="terminal-nav">
|
||||
<div class="back-nav">
|
||||
|
||||
<a href="/gedanken/" class="back-link">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer role="contentinfo"><p role="contentinfo">
|
||||
© Copyright 2026 ·
|
||||
Thomas
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user