From a286ba6a83a6394d470c24d56320089ff1c3b522 Mon Sep 17 00:00:00 2001 From: Derek Severin Date: Sat, 16 Jul 2022 14:42:45 +0700 Subject: About offsets + home image --- layouts/partials/sections/about.html | 67 ++++++++++++++++++++++-------------- layouts/partials/sections/home.html | 7 +++- static/css/theme.css | 43 +++++++++++++++++++---- 3 files changed, 85 insertions(+), 32 deletions(-) diff --git a/layouts/partials/sections/about.html b/layouts/partials/sections/about.html index de8b08f..6565780 100644 --- a/layouts/partials/sections/about.html +++ b/layouts/partials/sections/about.html @@ -26,6 +26,10 @@ {{ $offset_left = add $offset_left $remaining }} {{ $remaining = 0 }} {{ end }} +{{- $sum := add (add (add $main_side $extra_side) $offset_left) $offset_right -}} +{{- if gt $sum 12 -}} +ERROR: Sum of columns width bigger than 12! - Check "params.about" in "config.toml" +{{- end -}} {{ $offset_center := $remaining }}
- {{ if eq $params.layout "right" }} -
- {{ else if eq $params.layout "left" }} - {{ $offset_left := sub (sub 12 $extra_side) $main_side }} + {{- if eq $params.layout "right" -}} +
+ {{- else if eq $params.layout "left" -}} + {{- if gt $offset_left 0 -}}
- {{ end }} + {{- end -}} + {{- end -}} {{ if and (ne $params.layout "left") (ne $params.layout "right") }} {{/* ~Hack to add space outside (offset left) */}} {{/* @@ -76,23 +81,35 @@ {{ else }}
{{ end }} -
- {{ if .avatar }} - {{/* 2-REC: Special "hover easter egg" */}} - {{ if .avatar2 }} -
- - +
+
+ {{- $width_portrait := 12 -}} + {{- $width_text := 12 -}} + {{- if or (eq $params.layout "left") (eq $params.layout "right") -}} + {{- $width_portrait = $params.portrait_width -}} + {{- $width_text = sub 12 $width_portrait -}} + {{- end -}} + {{- if .avatar -}} +
+ {{/* 2-REC: Special "hover easter egg" */}} + {{- if .avatar2 -}} +
+ + +
+ {{- else -}} + + {{- end -}} +
+ {{- end -}} + {{- with .short_text -}} +
+
+ {{ . | markdownify }} +
- {{ else }} - - {{ end }} - {{ end }} - {{ with .short_text }} -
-

{{ . | markdownify }}

-
- {{ end }} + {{- end -}} +
{{ if .long_text }} {{ if and (ne $params.layout "left") (ne $params.layout "right") }} diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html index 97557e9..a630222 100644 --- a/layouts/partials/sections/home.html +++ b/layouts/partials/sections/home.html @@ -1,9 +1,14 @@ {{ $params := .Site.Params.home }} {{ with .Site.Data.home }}