From bd063c30e3a0160efe187d4a766e105157ba12fd Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 16 Aug 2025 19:46:06 +0200 Subject: change: make home template embed content/home.md --- README.md | 3 +++ layouts/_default/home.html | 16 +--------------- wiki/features/homepage.md | 14 +------------- wiki/setup.md | 7 ------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index bdaf2fa..f068fba 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ Tastefejl is a fork of the [Typo] Hugo theme, with the following changes: * Replaced the JavaScript theme switching code with a CSS media query. +* The home page embeds `content/home.md` rather than `homeIntroContent` from your `hugo.toml` + because Markdown text should be in `.md` files. + * Removed [Simple Icons] because I don't want to plaster brands on my website and at one point a 50MB .html file was committed (I filtered the git history to reduce the size of the repository.) diff --git a/layouts/_default/home.html b/layouts/_default/home.html index e58a520..e7c9058 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -2,21 +2,7 @@ {{ .Content }} -{{/* Intro summary section */}} - -{{ if or .Site.Params.homeIntroTitle .Site.Params.homeIntroContent }} -
- {{ with .Site.Params.homeIntroTitle }} -

{{ . }}

- {{ end }} - - {{ with .Site.Params.homeIntroContent }} -

{{ . | markdownify }}

- {{ end }} -
-{{ end }} - -{{/* Collection Section */}} +{{ readFile "content/home.md" | markdownify }} {{ if .Site.Params.homeCollection }} diff --git a/wiki/features/homepage.md b/wiki/features/homepage.md index db4cb37..7f81274 100644 --- a/wiki/features/homepage.md +++ b/wiki/features/homepage.md @@ -14,19 +14,7 @@ The homepage offers minimal customization options, you can specify an intro, and ## Intro Section -By setting those two parameters in your `hugo.toml` config you can control the text to display after the header on the homepage. Note that the body is interpreted as markdown. - -```toml -[params] -homeIntroTitle = 'Hi!' - -homeIntroContent = """ -I am an Italian Software Engineer with a strong foundation in computer science and a passion for solving complex problems. -I am interested in a range of topics, including algorithms, distributed systems, databases, and information retrieval. -""" -``` - -Note that you can omit one of the two if you want. +Text you write in `content/home.md` will be embedded after the header on the homepage. ## Display a Collection diff --git a/wiki/setup.md b/wiki/setup.md index 16e8dd5..d0752f4 100644 --- a/wiki/setup.md +++ b/wiki/setup.md @@ -86,13 +86,6 @@ theme = 'auto' colorPalette = 'default' hideHeader = false -# Intro on main page, content is markdown -homeIntroTitle = 'Hi!' -homeIntroContent = """ -I am an Italian Software Engineer with a strong foundation in computer science and a passion for solving complex problems. -I am interested in a range of topics, including algorithms, distributed systems, databases, and information retrieval. -""" - # Collection to display on home homeCollectionTitle = 'Posts' homeCollection = 'posts' -- cgit v1.2.3