From 0882a21997b0830f43643cac9f0de4beaa698988 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 29 Sep 2024 15:54:01 +0200 Subject: Rework author configuration --- layouts/_default/home.humanstxt.txt | 38 +++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'layouts/_default/home.humanstxt.txt') diff --git a/layouts/_default/home.humanstxt.txt b/layouts/_default/home.humanstxt.txt index 23286fe..98b1c79 100644 --- a/layouts/_default/home.humanstxt.txt +++ b/layouts/_default/home.humanstxt.txt @@ -1,12 +1,38 @@ -{{- $siteAuthor := partial "site-author.html" . -}} -{{- with $siteAuthor.name }} +{{- $authorName := "" }} +{{- $authorEmail := "" }} +{{- $authorGithub := "" }} +{{- $authorTwitter := "" }} +{{- $authorLocation := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end -}} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- with .github }} + {{- $authorGithub = . }} + {{- end }} + {{- with .twitter }} + {{- $authorTwitter = . }} + {{- end }} + {{- with .location }} + {{- $authorLocation = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} + +{{- with $authorName }} /* TEAM */ Author: {{ . }} -{{- with $siteAuthor.email }}{{ printf "\n Contact: %s" . }}{{ end }} -{{- with $siteAuthor.github }}{{ printf "\n GitHub: @%s" . }}{{ end }} -{{- with $siteAuthor.twitter }}{{ printf "\n Twitter: @%s" . }}{{ end }} -{{- with $siteAuthor.location }}{{ printf "\n From: %s" . }}{{ end }} +{{- with $authorEmail }}{{ printf "\n Contact: %s" . }}{{ end }} +{{- with $authorGithub }}{{ printf "\n GitHub: @%s" . }}{{ end }} +{{- with $authorTwitter }}{{ printf "\n Twitter: @%s" . }}{{ end }} +{{- with $authorLocation }}{{ printf "\n From: %s" . }}{{ end }} {{- end }} /* SITE */ -- cgit v1.2.3