Compare commits

...

3 Commits

Author SHA1 Message Date
5680cb604a chore: bump theme version
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-14 21:04:29 +01:00
daae005103 feat: Add note on adding notes ;) 2025-12-14 21:03:00 +01:00
3f29069c91 feat: Add notes as post type 2025-12-14 21:02:46 +01:00
5 changed files with 150 additions and 56 deletions

View File

@@ -9,79 +9,80 @@ googleAnalytics = ""
preserveTaxonomyNames = true
[privacy]
# Google Analytics privacy settings - https://gohugo.io/about/hugo-and-gdpr/index.html#googleanalytics
[privacy.googleAnalytics]
# set to true to disable service
disable = true
# set to true to meet General Data Protection Regulation (GDPR)
anonymizeIP = true
respectDoNotTrack = true
useSessionStorage = true
# Google Analytics privacy settings - https://gohugo.io/about/hugo-and-gdpr/index.html#googleanalytics
[privacy.googleAnalytics]
# set to true to disable service
disable = true
# set to true to meet General Data Protection Regulation (GDPR)
anonymizeIP = true
respectDoNotTrack = true
useSessionStorage = true
[tracking]
[tracking.oxitraffic]
enabled = true
hostname = "traffic.hyteck.de"
[tracking.oxitraffic]
enabled = true
hostname = "traffic.hyteck.de"
[params]
# Unmark to use post folder for images. Default is static folder.
#usepostimgfolder = true
slogan = "Blog of Julian-Samuel Gebühr"
description = "Blog of Julian-Samuel Gebühr" # meta description
# You need to set author to have an author bio. If you have a writer in the markdown file it will override this.
author = "Julian-Samuel Gebühr"
authorLink = "https://hyteck.de/"
bio = [
# Unmark to use post folder for images. Default is static folder.
#usepostimgfolder = true
slogan = "Blog of Julian-Samuel Gebühr"
description = "Blog of Julian-Samuel Gebühr" # meta description
# You need to set author to have an author bio. If you have a writer in the markdown file it will override this.
author = "Julian-Samuel Gebühr"
authorLink = "https://hyteck.de/"
bio = [
"Business Analyst for work, Developer for fun. Activist because it's necessary. He/Him"
]
copyright = [
]
copyright = [
'&copy; 2025 CC-BY Julian-Samuel Gebühr</a> '
]
]
email = "julian-samuel@gebuehr.net"
oxitraffic_url = "https://traffic.hyteck.de/count.js"
email = "julian-samuel@gebuehr.net"
oxitraffic_url = "https://traffic.hyteck.de/count.js"
# Nav links in the side bar
[[menu.main]]
name = "Home"
url = "/"
weight = 1
# Nav links in the side bar
[[menu.main]]
name = "Services"
url = "services/"
weight = 3
name = "Notes"
url = "notes/"
weight = 1
[[menu.main]]
name = "About"
url = "about/"
weight = 3
name = "Services"
url = "services/"
weight = 2
[[menu.main]]
name = "Privacy + Imprint"
url = "imprint/"
weight = 4
name = "About"
url = "about/"
weight = 3
[[menu.main]]
name = "Privacy + Imprint"
url = "imprint/"
weight = 4
# this will also be in author bio if there is no writer.
[params.social]
github = "https://github.com/moan0s"
email = "julian-samuel@gebuehr.net"
twitter = "https://twitter.com/jgebuehr"
linkedin = "https://www.linkedin.com/in/julian-samuel-gebühr/"
stackoverflow = "https://stackoverflow.com/users/9908321/gerjuli"
instagram = "https://www.instagram.com/julian_samuel_gebuehr/"
facebook = "https://www.facebook.com/juliansamuel.gebuhr"
mastodon = "https://chaos.social/@moanos"
rss = true
github = "https://github.com/moan0s"
email = "julian-samuel@gebuehr.net"
twitter = "https://twitter.com/jgebuehr"
linkedin = "https://www.linkedin.com/in/julian-samuel-gebühr/"
stackoverflow = "https://stackoverflow.com/users/9908321/gerjuli"
instagram = "https://www.instagram.com/julian_samuel_gebuehr/"
facebook = "https://www.facebook.com/juliansamuel.gebuhr"
mastodon = "https://chaos.social/@moanos"
rss = true
[[params.fediverse]]
url = "https://chaos.social/@moanos"
name = "Personal mastodon profile"
url = "https://chaos.social/@moanos"
name = "Personal mastodon profile"
[params.hosted_on]
src = '/img/uberspace_badge_dark.png'
alt = 'Badge saying: Proudly hosted on asteroids'
target = 'https://uberspace.de'
src = '/img/uberspace_badge_dark.png'
alt = 'Badge saying: Proudly hosted on asteroids'
target = 'https://uberspace.de'
[outputs]
home = ["HTML", "RSS"]
home = ["HTML", "RSS"]

6
content/notes/_index.md Normal file
View File

@@ -0,0 +1,6 @@
---
title: "Notes"
---
My notes are mainly a store of information for my future self. Here you find titbits of information, small HowTos and
such. Do not expect the quality of a blogpost for these.

View File

@@ -0,0 +1,61 @@
---
title: "Adding another post type to Hugo"
date: 2025-12-14T7:30:00+02:00
draft: false
subtitle: "How I added notes as content type to hugo in addition to the standard posts and pages."
---
Notes are short posts that focus on a small bit of information. Other than my blogposts they do not try to give a
complete picture or a full explanation. They are more of a brain-dump of mine with a low bar of typing them out.
So how did I add them?
1. **Create a notes folder:** The folder in `content/notes` will hold the notes
2. **Add rendering template:** Hugo needs to know what to do here, so add a rendering template in
`layouts/notes/list.html`. A sample is provided below.
3. Add `content/notes/_index.md` with a short explanation of the
### Styling template
```html
{{ define "main" }}
<h1">Notes</h1>
<div>
{{ .Content }}
</div>
<ul>
{{ range .Pages.ByDate.Reverse }}
<li
">
<h2>
<a href="{{ .Permalink }} "> {{ .Title }} </a>
</h2>
<small">{{ .Date.Format "2006-01-02" }}</small>
{{ if .Params.subtitle }}
<p>{{ .Params.subtitle }}</p>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
```
As you can see, I added an optional subtitel. They make it much easier to find a note that is interesting, but should
not be necessary to lower the bar for the author. Subtitles can be specified like this
```markdown
---
title: "Adding another post type to Hugo"
date: 2025-12-14T7:30:00+02:00
draft: false
subtitle: "How I added notes as content type to hugo in addition to the standard posts and pages."
---
Notes are short posts
```

26
layouts/notes/list.html Normal file
View File

@@ -0,0 +1,26 @@
{{ define "main" }}
<h1 style="color: whitesmoke">Notes</h1>
<div style="color: whitesmoke;">
{{ .Content }}
</div>
<ul style="list-style-type:none">
{{ if (.Pages.ByDate.Reverse) }}
{{ range .Pages.ByDate.Reverse }}
<li class="block">
<h2>
<a href="{{ .Permalink }} " style="color: whitesmoke;"> {{ .Title }} </a>
</h2>
<small style="color: whitesmoke;">{{ .Date.Format "2006-01-02" }}</small>
{{ if .Params.subtitle }}
<p style="color: whitesmoke">{{ .Params.subtitle }}</p>
{{ end }}
</li>
{{ end }}
{{ else }}
No notes found.
{{ end }}
</ul>
{{ end }}