summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco <tomaselli.fr@gmail.com>2024-04-29 19:56:50 +0200
committerFrancesco <tomaselli.fr@gmail.com>2024-04-29 20:05:40 +0200
commit74329c51844759d20e973f30fdcc173bf833be95 (patch)
tree8592a7a043f9e5a4e746d2fcc8e325df55c3f474
parentf7131b852c48742226934105df68229f3a1408a8 (diff)
Removed unnecessary homeIntro parameter, cleaned up layouts
-rw-r--r--README.md7
-rw-r--r--layouts/404.html1
-rw-r--r--layouts/_default/home.html11
-rw-r--r--layouts/_default/single.html19
4 files changed, 20 insertions, 18 deletions
diff --git a/README.md b/README.md
index 0dd824b..b41234f 100644
--- a/README.md
+++ b/README.md
@@ -72,6 +72,8 @@ In your `hugo.toml` file you can specify the preferred theme:
theme = "light | dark | auto"
```
+If nothing is set, the default setting is auto.
+
### 2.3 Dark and light mode images
You can tags to decide if images are displayed in dark or light mode, as GitHub is doing for readmes.
@@ -130,11 +132,10 @@ disableKinds = ['taxonomy']
googleAnalytics = "G-xxxxxxxxxx"
[params]
-# Math mode
-math = true
+# Appearance
+theme = 'auto'
# Intro on main page, content in markdown, if you omit title or content the other can be displayed
-homeIntro = true
homeIntroTitle = 'Hello traveler!'
homeIntroContent = """
Join me on this journey as I explore the ever-evolving landscape of software engineering,
diff --git a/layouts/404.html b/layouts/404.html
index 75b031c..72ef81e 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -6,6 +6,7 @@
<h1> typo? </h1>
<p> Click <a href="/"> here </a> to return to home </p>
</div>
+
</div>
diff --git a/layouts/_default/home.html b/layouts/_default/home.html
index bc3aad8..e251ce3 100644
--- a/layouts/_default/home.html
+++ b/layouts/_default/home.html
@@ -3,18 +3,17 @@
{{ .Content }}
{{/* Intro summary section */}}
-{{ if .Site.Params.homeIntro }}
+{{ if or .Site.Params.homeIntroTitle .Site.Params.homeIntroContent }}
<div class="intro">
- {{ if .Site.Params.homeIntroTitle }}
- <h1>{{ .Site.Params.homeIntroTitle }}</h1>
+ {{ with .Site.Params.homeIntroTitle }}
+ <h1>{{ . }}</h1>
{{ end }}
- {{ if .Site.Params.homeIntroContent }}
- <p>{{ .Site.Params.homeIntroContent | markdownify }}</p>
+ {{ with .Site.Params.homeIntroContent }}
+ <p>{{ . | markdownify }}</p>
{{ end }}
</div>
-
{{ end }}
{{/* Social Icons */}}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 9a478f7..c0f41c5 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -2,28 +2,29 @@
{{/* Intro */}}
-<div {{ if .Param "autonumber" }} class="autonumber" {{end}}>
+<div {{ if .Param "autonumber" }} class="autonumber" {{ end }}>
<div class=" single-intro-container">
{{/* Title and Summary */}}
<h1 class="single-title">{{ .Title }}</h1>
- {{if .Param "summary" }}
- <p class="single-summary">{{ .Summary }}</p>
+ {{ with .Param "summary" }}
+ <p class="single-summary">{{ . }}</p>
{{ end }}
{{/* Reading Time */}}
<p class="single-readtime">
- {{if .Date }}
- {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
- {{ $dateHuman := .Date | time.Format ":date_long" }}
+ {{ with .Date }}
+ {{ $dateMachine := . | time.Format "2006-01-02T15:04:05-07:00" }}
+ {{ $dateHuman := . | time.Format ":date_long" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
- -
{{end}}
- {{if (.Param "readTime")}}
- {{.ReadingTime}} min
+
+ {{ if .Param "readTime" }}
+ -
+ {{ .ReadingTime }} min
{{end }}
</p>