===== Links ===== * https://gohugo.io/documentation/ * https://themes.gohugo.io/gohugo-theme-ananke/ * https://themes.gohugo.io/hugo-theme-diary/ * https://themes.gohugo.io/beautifulhugo/ * https://www.webfx.com/tools/emoji-cheat-sheet/ (requires enableEmojis = true) * https://github.com/liwenyip/hugo-easy-gallery/ * [[https://media.ccc.de/v/clt24-249-static-website-am-beispiel-hugo|Static Website am Beispiel Hugo]] -- German video ===== 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 ===== * https://gohugo.io/content-management/shortcodes/ # 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<}} Normal text. _italic text_ This video is worth watching. {{< youtube dAEr3WfrPM8 >}} EOT hugo -D ===== More complex site 2 ===== cat >content/posts/jap-work2.md< ===== 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" ===== Gallery setup and usage ===== 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<}} content2 EOT mkdir -p static/img/galltest cp /2018*jpg static/img/galltest/ hugo ===== Comments with Mastodon/Fediverse ===== * Deploy the code from https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/ in file themes/diary/layouts/partials/comment.html * mkdir static/assets/js * copy purify.min.js from https://github.com/cure53/DOMPurify to static/assets/js * modify markup with the details from an existing Mastodon thread: vi content/posts/2022/index.md [..] comments: host: mastodon.server.org username: mastodonusername id: 105105837123123123 [..] * regenerate the page: hugo