From 852f10e2176946dadbedb11a0a1b95415607e468 Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Wed, 1 Apr 2020 14:17:49 +0200 Subject: [PATCH] whitespaces in templates... --- custom_syadmin/git_hooks_post-receive.sh | 20 ++--- .../_default/_markup/render-image.html | 84 +++++++++---------- 2 files changed, 50 insertions(+), 54 deletions(-) diff --git a/custom_syadmin/git_hooks_post-receive.sh b/custom_syadmin/git_hooks_post-receive.sh index 079331c..634d23c 100644 --- a/custom_syadmin/git_hooks_post-receive.sh +++ b/custom_syadmin/git_hooks_post-receive.sh @@ -39,10 +39,9 @@ do cd $TMP_WEBSITE [ -d $WEBSITE ] || mkdir -p $WEBSITE - if [ -d $WEBSITE ] - then - safe-rm -rf ${WEBSITE}* - fi + if [ -d $WEBSITE ]; then + safe-rm -rf ${WEBSITE}* + fi $HUGO_PATH -e gitea -d $WEBSITE > ${TMP_WEBSITE}/last-commit-log.txt printf "\n>> $d\n>> `date`" >> ${TMP_WEBSITE}/last-commit-log.txt @@ -61,7 +60,7 @@ do if [ $BRK = "brk" ]; then break fi - + cd $CWD refs=`$GIT_PATH show --format="%s" -s` IFS=$' ' @@ -74,10 +73,9 @@ do [ -d $WEBSITE ] || mkdir -p $WEBSITE - if [ -d $WEBSITE ] - then + if [ -d $WEBSITE ]; then safe-rm -rf ${WEBSITE}* - fi + fi $HUGO_PATH -e gitea -d $WEBSITE > ${TMP_WEBSITE}/last-commit-log.txt printf "\n>> $d\n>> `date`" >> ${TMP_WEBSITE}/last-commit-log.txt @@ -103,8 +101,7 @@ cd $TMP_WEBSITEPREVIEW echo 'edit = true' > data/myvars.toml echo 'giturl="'${GIT_URL}'"' >> data/myvars.toml -if [ -d $WEBSITEPREVIEW ] - then +if [ -d $WEBSITEPREVIEW ]; then safe-rm -rf $WEBSITEPREVIEW fi @@ -113,8 +110,7 @@ $HUGO_PATH -e gitea -d $WEBSITEPREVIEW > ${TMP_WEBSITEPREVIEW}/last-commit-log.t printf "\n>> $d\n>> `date`" >> ${TMP_WEBSITEPREVIEW}/last-commit-log.txt mv ${TMP_WEBSITEPREVIEW}/last-commit-log.txt $WEBSITEPREVIEW -if [ -d $TMP_WEBSITEPREVIEW ] - then +if [ -d $TMP_WEBSITEPREVIEW ]; then safe-rm -rf $TMP_WEBSITEPREVIEW fi diff --git a/themes/piratecare/layouts/_default/_markup/render-image.html b/themes/piratecare/layouts/_default/_markup/render-image.html index 2bffdd0..63a601a 100644 --- a/themes/piratecare/layouts/_default/_markup/render-image.html +++ b/themes/piratecare/layouts/_default/_markup/render-image.html @@ -1,42 +1,42 @@ -{{ $text_link := .Text }} -{{ if strings.HasPrefix .Destination "bib:" }} - {{ $destination := (substr .Destination 4) }} - {{ if index $.Page.Site.Data.books.piratecarecollection $destination }} - {{ $b := index $.Page.Site.Data.books.piratecarecollection $destination }} - {{ if not $text_link }} - {{ delimit $b.authors ", " " & " }}{{ with $b.pubdate }}, {{ substr . 0 4}}{{ end }}.‘{{ $b.title }}’. {{ with $b.publisher }}{{ . }}.{{ end }} - {{ else }} - {{ $text_link }} - {{ end }} - {{ else }} - {{ $text_link }}⦚bib:{{ $destination }} not found - {{ end }} -{{ else if strings.HasPrefix .Destination "session:" }} - {{ $s_destination := printf "/session/%s" (substr .Destination 8) }} - {{ if $.Page.Site.GetPage $s_destination }} - {{ $session := $.Page.Site.GetPage $s_destination }} - {{ if not $text_link }} - {{ $session.Title }} - {{ else }} - {{ $text_link }} - {{ end }} - {{ else }} - {{ $text_link }}⦚session:{{ $s_destination }} not found - {{ end }} -{{ else if strings.HasPrefix .Destination "topic:" }} - {{ $t_destination := printf "/topic/%s" (substr .Destination 6) }} - {{ if $.Page.Site.GetPage $t_destination }} - {{ $topic := $.Page.Site.GetPage $t_destination }} - {{ if not $text_link }} - {{ $topic.Title }} - {{ else }} - {{ $text_link }} - {{ end }} - {{ else }} - {{ $text_link }}⦚topic:{{ $t_destination }} not found - {{ end }} -{{ else if findRE "^.*static" .Destination }} - {{ .Text }} -{{ else }} - {{ .Text }} -{{ end }} +{{- $text_link := .Text -}} +{{- if strings.HasPrefix .Destination "bib:" -}} + {{- $destination := (substr .Destination 4) -}} + {{- if index $.Page.Site.Data.books.piratecarecollection $destination -}} + {{- $b := index $.Page.Site.Data.books.piratecarecollection $destination -}} + {{- if not $text_link -}} + {{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.‘{{- $b.title -}}’. {{- with $b.publisher -}}{{- . -}}.{{- end -}} + {{- else -}} + {{- $text_link -}} + {{- end -}} + {{- else -}} + {{- $text_link -}}⦚bib:{{- $destination -}} not found + {{- end -}} +{{- else if strings.HasPrefix .Destination "session:" -}} + {{- $s_destination := printf "/session/%s" (substr .Destination 8) -}} + {{- if $.Page.Site.GetPage $s_destination -}} + {{- $session := $.Page.Site.GetPage $s_destination -}} + {{- if not $text_link -}} + {{- $session.Title -}} + {{- else -}} + {{- $text_link -}} + {{- end -}} + {{- else -}} + {{- $text_link -}}⦚session:{{- $s_destination -}} not found + {{- end -}} +{{- else if strings.HasPrefix .Destination "topic:" -}} + {{- $t_destination := printf "/topic/%s" (substr .Destination 6) -}} + {{- if $.Page.Site.GetPage $t_destination -}} + {{- $topic := $.Page.Site.GetPage $t_destination -}} + {{- if not $text_link -}} + {{- $topic.Title -}} + {{- else -}} + {{- $text_link -}} + {{- end -}} + {{- else -}} + {{- $text_link -}}⦚topic:{{- $t_destination -}} not found + {{- end -}} +{{- else if findRE "^.*static" .Destination -}} + {{- .Text -}} +{{- else -}} + {{- .Text -}} +{{- end -}}