Site Tools


Sidebar

software:hugo

Current default setup

# as user
hugo new site blog-hugo --format yaml
cd blog-hugo
git clone https://github.com/amazingrise/hugo-theme-diary themes/diary
echo 'theme: diary' >> config.yaml

# customize the URL
sed -ie 's,baseURL.*,baseURL: https://localhost/,' config.yaml

git clone https://github.com/liwenyip/hugo-easy-gallery/
cp -r hugo-easy-gallery/layouts/shortcodes/ layouts/
cp -r hugo-easy-gallery/static/* static/

hugo new posts/my-first-post.md
# add some content after the header
echo 'There be dragons!' >>content/posts/my-first-post.md
# change status from draft
sed -ie 's,draft.*,draft: false,' content/posts/my-first-post.md

# now build the content
hugo

# in a different terminal, if you want to serve it for testing
hugo server

More complex site

# create the site as directory
hugo new posts/jap-day-at-office/index.md

cp /tmp/picture.jpg content/posts/jap-day-at-office/
cat >>content/posts/jap-work/index.md<<EOT

I guess this is the only country where one could receive a Red Hat
branded soy sauce as a goody on the first day of work :)

## This is a header

### This is a subheader

This is an example for a [link](https://fluxcoil.net)

![startday_things](picture.jpg)

{{< figure src="/images/pic.jpg" title="pic description" >}}

Normal text. _italic text_

This video is worth watching.
{{< youtube dAEr3WfrPM8 >}}
EOT

hugo -D

More complex site 2

cat >content/posts/jap-work2.md<<EOT
---
date: 2017-04-14T11:25:05-04:00
description: "desc"
featured_image: "/images/pic.jpg"
tags: []
title: "title"
disable_share: false
---
text
EOT

Tags

https://www.jakewiesler.com/blog/hugo-taxonomies helped me to understand this. I simply want to use “tags” in my documents, and then I want an overview page which lists all tags, and where one can access all documents which contain these tags. I use the “beautiful hugo” theme: https://themes.gohugo.io/beautifulhugo/ .

### first, use tags in the header of your documents
hugo new posts/newdoc.md
vi content/posts/newdoc.md

---
title: "Japan - to San or Not to San"
date: 2020-10-06T14:52:19+02:00
tags: ["japan", "life"]
draft: false
---
Content here

### then, create a plain tags infrastructure
mkdir content/tags

### then, recreate your docs
hugo

### ..and your menu has the "tags" menu

Theme Beautifulhugo

# background image config in config.toml:
[[Params.bigimg]]
  src = "/images/20121103_154205_matsuyama_dogo_onsen_topview_hq-slim2.jpg"
  desc = "Matsuyama"
  position = "center top"
cd /opt/web/blogtest-hugo
git clone https://github.com/liwenyip/hugo-easy-gallery/
cp -r hugo-easy-gallery/layouts/shortcodes/ layouts/
cp -r hugo-easy-gallery/static/* static/

hugo new posts/2020/10/galltest/index.md
cat >>content/posts/2020/10/galltest/index.md<<EOT

content
{{< gallery dir="/img/galltest/" />}}
content2
EOT

mkdir -p static/img/galltest
cp <path>/2018*jpg static/img/galltest/

hugo

Comments with Mastodon/Fediverse

vi content/posts/2022/index.md
[..]
comments:
  host: mastodon.server.org
  username: mastodonusername
  id: 105105837123123123
[..]
  • regenerate the page: hugo
software/hugo.txt · Last modified: 2024/03/25 02:20 by chris