User Tools

Site Tools


Sidebar

software:hugo

Debian

# as root
wget https://github.com/gohugoio/hugo/releases/download/v0.75.1/hugo_0.75.1_Linux-64bit.deb
dpkg -i hugo_0.75.1_Linux-64bit.deb

# as user
cd ~
hugo new site blog-hugo
cd blog-hugo
git init
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
echo 'theme = "ananke"' >> config.toml
hugo new posts/my-first-post.md
vi content/posts/my-first-post.md
# add some content after the header
vi config.toml
# baseURL = "https://blog.fluxcoil.net/"

# now build the content
hugo -D

# customizing
cat themes/ananke/exampleSite/config.toml >>config.toml
vim config.toml

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
touch content/tags/tech.md

### 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
software/hugo.txt · Last modified: 2020/10/31 02:48 by chris