diff --git a/wowchemy/assets/scss/wowchemy/_root.scss b/wowchemy/assets/scss/wowchemy/_root.scss index 02819ae9..78899424 100644 --- a/wowchemy/assets/scss/wowchemy/_root.scss +++ b/wowchemy/assets/scss/wowchemy/_root.scss @@ -48,6 +48,9 @@ body.no-navbar { min-height: calc(100vh - 50px); } } +.page-wrapper.no-navbar { + min-height: 100vh; +} .page-header, .page-footer { diff --git a/wowchemy/assets/scss/wowchemy/_widgets.scss b/wowchemy/assets/scss/wowchemy/_widgets.scss index 6fafee33..f8915cd1 100644 --- a/wowchemy/assets/scss/wowchemy/_widgets.scss +++ b/wowchemy/assets/scss/wowchemy/_widgets.scss @@ -28,6 +28,9 @@ min-height: calc(100vh - 50px); } } +.no-navbar .home-section.fullscreen { + min-height: 100vh; +} /* Override dark colors that may be inherited from body.dark */ .home-section.dark, @@ -66,8 +69,19 @@ top: 100%; }*/ +// Fill padding of `.home-section` parent +.home-section-bg { + position: absolute; + top: 0; + left: 0; + height: fill-available; + height: -webkit-fill-available; + width: fill-available; + width: -webkit-fill-available; +} + /* Default background image properties for home sections. */ -.home-section.bg-image { +.home-section-bg .bg-image { background-position: center; background-repeat: no-repeat; background-size: cover; @@ -557,24 +571,24 @@ ul.ul-edu li .description p.institution { * Contact **************************************************/ -.contact-widget .fa-ul { +.wg-contact .fa-ul { margin-left: 3.14285714rem; /* Must be > `fa-2x` icon size. */ } -.contact-widget .fa-li { +.wg-contact .fa-li { position: absolute; - left: -3.14285714rem; /* Negative of `.contact-widget .fa-ul` margin. */ + left: -3.14285714rem; /* Negative of `.wg-contact .fa-ul` margin. */ width: 2rem; /* Match `fa-2x` icon size. */ top: 0.14285714em; /* Default FA value. */ text-align: center; } -.contact-widget li { +.wg-contact li { padding-top: 0.8rem; /* Align text with bottom of `fa-2x` icon. */ margin-bottom: 0.3rem; } -.contact-widget li:last-of-type { +.wg-contact li:last-of-type { margin-bottom: 0; } diff --git a/wowchemy/layouts/partials/widget_page.html b/wowchemy/layouts/partials/widget_page.html index c4b2c647..946c2777 100644 --- a/wowchemy/layouts/partials/widget_page.html +++ b/wowchemy/layouts/partials/widget_page.html @@ -28,13 +28,14 @@ {{/* Begin widget styling */}} {{ $bg := $st.Params.design.background }} {{ $style := "" }} + {{ $style_bg := "" }} {{ if $bg.color }} - {{ $style = printf "background-color: %s;" ($bg.color | default "transparent") }} + {{ $style_bg = printf "background-color: %s;" ($bg.color | default "transparent") }} {{ end }} {{ if and $bg.gradient_start $bg.gradient_end }} - {{ $style = printf "%sbackground-image: linear-gradient(%s, %s);" $style $bg.gradient_start $bg.gradient_end }} + {{ $style_bg = printf "%sbackground-image: linear-gradient(%s, %s);" $style_bg $bg.gradient_start $bg.gradient_end }} {{ end }} {{ if $bg.image }} @@ -44,14 +45,14 @@ {{ end }} {{/* See Hugo note on linking assets in styles: https://github.com/gohugoio/hugoThemes#common-permalink-issues */}} {{ $media_dir := $.Scratch.Get "media_dir" }} - {{ $style = printf "%sbackground-image: %s url('%s');" $style $darken (printf "%s/%s" $media_dir $bg.image | absURL) }} + {{ $style_bg = printf "%sbackground-image: %s url('%s');" $style_bg $darken (printf "%s/%s" $media_dir $bg.image | absURL) }} {{ with $bg.image_size }} {{/* Allow sizes: actual, cover, and contain. */}} - {{ $style = printf "%sbackground-size: %s;" $style (replace . "actual" "auto") }} + {{ $style_bg = printf "%sbackground-size: %s;" $style_bg (replace . "actual" "auto") }} {{ end }} {{ with $bg.image_position }} {{/* Allow valid CSS positions including left, center, and right. */}} - {{ $style = printf "%sbackground-position: %s;" $style . }} + {{ $style_bg = printf "%sbackground-position: %s;" $style_bg . }} {{ end }} {{ end }} @@ -98,9 +99,37 @@ {{ $use_container = $cfg.use_container }} {{end}} -
+ {{ $columns := $st.Params.design.columns | default "2" }} + {{ $use_cols := in (slice "pages" "featured" "experience" "accomplishments" "contact" "blank" "tag_cloud") $widget }} + + {{/* Dedicated child div for bg prevents parallax 100% height issue within new CSS grid page wrapper. */}} +
+
{{if $use_container}}
{{end}} + + {{if $use_cols}} +
+ {{ if $st.Title }} + {{ if eq $columns "1" }} +
+ {{ with $st.Title }}

{{.}}

{{ end }} + {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} +
+ {{else}} +
+ {{ with $st.Title }}

{{.}}

{{ end }} + {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} +
+ {{end}} + {{end}} + {{end}} + {{ partial $widget_path $widget_args }} + + {{if $use_cols}} +
+ {{end}} + {{if $use_container}}
{{end}}
{{ end }} diff --git a/wowchemy/layouts/partials/widgets/accomplishments.html b/wowchemy/layouts/partials/widgets/accomplishments.html index c9a8cf25..4592d37d 100644 --- a/wowchemy/layouts/partials/widgets/accomplishments.html +++ b/wowchemy/layouts/partials/widgets/accomplishments.html @@ -1,48 +1,43 @@ {{ $ := .root }} {{ $page := .page }} +{{ $columns := $page.Params.design.columns | default "2" }} -
-
-

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ with $page.Content }}{{ . }}{{ end }} +
+ {{ with $page.Content }}{{ . }}{{ end }} - {{ if $page.Params.item }} - {{ range $idx, $key := sort $page.Params.item ".date_start" "desc" }} -
-
- {{- with .url -}}{{- end -}} -

{{.title | markdownify | emojify}}

- {{- with .url -}}
{{- end -}} + {{ if $page.Params.item }} + {{ range $idx, $key := sort $page.Params.item ".date_start" "desc" }} +
+
+ {{- with .url -}}{{- end -}} +

{{.title | markdownify | emojify}}

+ {{- with .url -}}
{{- end -}} - + + {{with .description}} +
{{. | markdownify | emojify}}
+ {{end}} + + {{ with .certificate_url }} + + {{ i18n "see_certificate" | default "See certificate" }} + + {{ end }}
- {{end}} - {{end}} -
+
+ {{end}} + {{end}}
diff --git a/wowchemy/layouts/partials/widgets/blank.html b/wowchemy/layouts/partials/widgets/blank.html index 9f75bef1..0e8dd28e 100644 --- a/wowchemy/layouts/partials/widgets/blank.html +++ b/wowchemy/layouts/partials/widgets/blank.html @@ -1,20 +1,12 @@ {{ $st := .page }} {{ $columns := $st.Params.design.columns | default "2" }} -
- {{ if ne $columns "1" }} -
- {{ with $st.Title }}

{{ . | markdownify | emojify }}

{{ end }} - {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} -
-
- {{ $st.Content }} -
- {{ else }} -
- {{ with $st.Title }}

{{ . | markdownify | emojify }}

{{ end }} - {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} - {{ $st.Content }} -
- {{ end }} -
+{{ if ne $columns "1" }} +
+ {{ $st.Content }} +
+{{ else }} +
+ {{ $st.Content }} +
+{{ end }} diff --git a/wowchemy/layouts/partials/widgets/contact.html b/wowchemy/layouts/partials/widgets/contact.html index d32ff77e..be93d7da 100644 --- a/wowchemy/layouts/partials/widgets/contact.html +++ b/wowchemy/layouts/partials/widgets/contact.html @@ -5,152 +5,137 @@ {{ $columns := $st.Params.design.columns | default "2" }} -
- {{ if $st.Title }} - {{ if eq $columns "1" }} -
- {{ with $st.Title }}

{{.}}

{{ end }} - {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} +
+ {{ with $st.Content }}{{ . }}{{ end }} + + {{ if $st.Params.email_form }} + + {{ $post_action := "" }} + {{ if eq $st.Params.email_form 1 }} + {{ $post_action = "netlify" }} + {{ else }} + {{ if not $data.email }} + {{ errorf "Please set an email address for the contact form using the `email` parameter in `params.toml`. Otherwise, set `email_form = 0` to disable the contact form." }} + {{ end }} + {{ $post_action = printf "action=\"https://formspree.io/%s\"" $data.email }} + {{end}} + +
+
+
+ +
- {{else}} -
- {{ with $st.Title }}

{{.}}

{{ end }} - {{ with $st.Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} +
+ + +
+
+ + +
+ {{ if eq $st.Params.email_form 1 }} +
+
- {{end}} - {{ end }} -
- {{ with $st.Content }}{{ . }}{{ end }} - - {{ if $st.Params.email_form }} - - {{ $post_action := "" }} - {{ if eq $st.Params.email_form 1 }} - {{ $post_action = "netlify" }} - {{ else }} - {{ if not $data.email }} - {{ errorf "Please set an email address for the contact form using the `email` parameter in `params.toml`. Otherwise, set `email_form = 0` to disable the contact form." }} {{ end }} - {{ $post_action = printf "action=\"https://formspree.io/%s\"" $data.email }} - {{end}} - -
- -
- - -
-
- - -
-
- - -
- {{ if eq $st.Params.email_form 1 }} -
- -
- {{ end }} - {{ if $st.Params.netlify.captcha }} -
- {{ end }} - - -
- {{end}} - -
    - - {{ if and $data.email (not $st.Params.email_form) }} -
  • - - - {{- if $autolink }}{{ $data.email }}{{ else }}{{ $data.email }}{{ end -}} - -
  • + {{ if $st.Params.netlify.captcha }} +
    {{ end }} + + +
+ {{end}} - {{ with $data.phone }} -
  • - - - {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} - -
  • - {{ end }} +
      - {{ $addr_formatted := "" }}{{/* Scoping for maps. */}} - {{ if $data.address.street | or $data.address.city | or $data.address.region | or $data.address.postcode | or $data.address.country }} - {{ $addr_formatted = partial "functions/get_address" (dict "root" . "address" $data.address) }} -
    • - - {{$addr_formatted}} -
    • - {{ end }} - - {{ with $data.directions }} -
    • - - {{ . | markdownify | emojify }} -
    • - {{ end }} - - {{ with $data.office_hours }} -
    • - - - {{- if not (reflect.IsSlice .)}}{{/* Support legacy string format. */}} - {{- . | markdownify | emojify -}} - {{else}} - {{- delimit . "
      " | markdownify | emojify -}} - {{end -}} -
      -
    • - {{ end }} - - {{ with $data.appointment_url }} -
    • - - {{ i18n "book_appointment" | default "Book an appointment" }} -
    • - {{ end }} - - {{/* Contact links. */}} - {{ range $data.contact_links }} - {{ $pack := or .icon_pack "fas" }} - {{ $pack_prefix := $pack }} - {{ if in (slice "fab" "fas" "far" "fal") $pack }} - {{ $pack_prefix = "fa" }} - {{ end }} - {{ $link := .link }} - {{ $scheme := (urls.Parse $link).Scheme }} - {{ $target := "" }} - {{ if not $scheme }} - {{ $link = .link | relLangURL }} - {{ else if in (slice "http" "https") $scheme }} - {{ $target = "target=\"_blank\" rel=\"noopener\"" }} - {{ end }} -
    • - - {{.name|markdownify|emojify|safeHTML}} -
    • - {{ end }} - -
    - - {{ if and site.Params.map.engine $data.coordinates.latitude }} -
    - - - - - - -
    -
    + {{ if and $data.email (not $st.Params.email_form) }} +
  • + + + {{- if $autolink }}{{ $data.email }}{{ else }}{{ $data.email }}{{ end -}} + +
  • {{ end }} + {{ with $data.phone }} +
  • + + + {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} + +
  • + {{ end }} + + {{ $addr_formatted := "" }}{{/* Scoping for maps. */}} + {{ if $data.address.street | or $data.address.city | or $data.address.region | or $data.address.postcode | or $data.address.country }} + {{ $addr_formatted = partial "functions/get_address" (dict "root" . "address" $data.address) }} +
  • + + {{$addr_formatted}} +
  • + {{ end }} + + {{ with $data.directions }} +
  • + + {{ . | markdownify | emojify }} +
  • + {{ end }} + + {{ with $data.office_hours }} +
  • + + + {{- if not (reflect.IsSlice .)}}{{/* Support legacy string format. */}} + {{- . | markdownify | emojify -}} + {{else}} + {{- delimit . "
    " | markdownify | emojify -}} + {{end -}} +
    +
  • + {{ end }} + + {{ with $data.appointment_url }} +
  • + + {{ i18n "book_appointment" | default "Book an appointment" }} +
  • + {{ end }} + + {{/* Contact links. */}} + {{ range $data.contact_links }} + {{ $pack := or .icon_pack "fas" }} + {{ $pack_prefix := $pack }} + {{ if in (slice "fab" "fas" "far" "fal") $pack }} + {{ $pack_prefix = "fa" }} + {{ end }} + {{ $link := .link }} + {{ $scheme := (urls.Parse $link).Scheme }} + {{ $target := "" }} + {{ if not $scheme }} + {{ $link = .link | relLangURL }} + {{ else if in (slice "http" "https") $scheme }} + {{ $target = "target=\"_blank\" rel=\"noopener\"" }} + {{ end }} +
  • + + {{.name|markdownify|emojify|safeHTML}} +
  • + {{ end }} + + + + {{ if and site.Params.map.engine $data.coordinates.latitude }} +
    + + + + + +
    +
    + {{ end }} +
    diff --git a/wowchemy/layouts/partials/widgets/experience.html b/wowchemy/layouts/partials/widgets/experience.html index 77bba116..9996c627 100644 --- a/wowchemy/layouts/partials/widgets/experience.html +++ b/wowchemy/layouts/partials/widgets/experience.html @@ -1,59 +1,54 @@ {{ $ := .root }} {{ $page := .page }} +{{ $columns := $page.Params.design.columns | default "2" }} -
    -
    -

    {{ with $page.Title }}{{ . | markdownify }}{{ end }}

    - {{ with $page.Params.subtitle }}

    {{ . | markdownify }}

    {{ end }} -
    -
    - {{ with $page.Content }}{{ . }}{{ end }} +
    + {{ with $page.Content }}{{ . }}{{ end }} - {{ if $page.Params.experience }} - {{ $exp_len := len $page.Params.experience }} - {{ range $idx, $key := sort $page.Params.experience ".date_start" "desc" }} -
    - -
    -
    -
     
    -
     
    -
    -
    -   -
    -
    -
     
    -
     
    -
    + {{ if $page.Params.experience }} + {{ $exp_len := len $page.Params.experience }} + {{ range $idx, $key := sort $page.Params.experience ".date_start" "desc" }} +
    + +
    +
    +
     
    +
     
    - -
    -
    -
    -

    {{.title | markdownify | emojify}}

    -

    - {{- with .company_url}}{{end}}{{.company | markdownify | emojify}}{{with .company_url}}{{end -}} -

    -
    - {{ (time .date_start).Format ($page.Params.date_format | default "January 2006") }} – - {{ if .date_end}} - {{ (time .date_end).Format ($page.Params.date_format | default "January 2006") }} - {{else}} - {{ i18n "present" | default "Present" }} - {{end}} - {{with .location}} - - {{.}} - {{end}} -
    - {{with .description}}
    {{. | markdownify | emojify}}
    {{end}} +
    +   +
    +
    +
     
    +
     
    +
    +
    + +
    +
    +
    +

    {{.title | markdownify | emojify}}

    +

    + {{- with .company_url}}{{end}}{{.company | markdownify | emojify}}{{with .company_url}}{{end -}} +

    +
    + {{ (time .date_start).Format ($page.Params.date_format | default "January 2006") }} – + {{ if .date_end}} + {{ (time .date_end).Format ($page.Params.date_format | default "January 2006") }} + {{else}} + {{ i18n "present" | default "Present" }} + {{end}} + {{with .location}} + + {{.}} + {{end}}
    + {{with .description}}
    {{. | markdownify | emojify}}
    {{end}}
    - {{end}} - {{end}}
    + {{end}} + {{end}}
    diff --git a/wowchemy/layouts/partials/widgets/featured.html b/wowchemy/layouts/partials/widgets/featured.html index 95e65920..8e561946 100644 --- a/wowchemy/layouts/partials/widgets/featured.html +++ b/wowchemy/layouts/partials/widgets/featured.html @@ -48,26 +48,23 @@ {{ $i18n = "more_pages" }} {{ end }} -
    -
    -

    {{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}

    - {{ with $st.Params.subtitle }}

    {{ . | markdownify | emojify }}

    {{ end }} -
    -
    +{{ $columns := $st.Params.design.columns | default "2" }} - {{ with $st.Content }}{{ . }}{{ end }} +
    - {{ range $post := $query }} - {{ if eq $st.Params.design.view 1 }} - {{ partial "li_list" . }} - {{ else if eq $st.Params.design.view 3 }} - {{ partial "li_card" . }} - {{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }} - {{ partial "li_citation" . }} - {{ else }} - {{ partial "li_compact" . }} - {{ end }} - {{end}} + {{ with $st.Content }}{{ . }}{{ end }} + + {{ range $post := $query }} + {{ if eq $st.Params.design.view 1 }} + {{ partial "li_list" . }} + {{ else if eq $st.Params.design.view 3 }} + {{ partial "li_card" . }} + {{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }} + {{ partial "li_citation" . }} + {{ else }} + {{ partial "li_compact" . }} + {{ end }} + {{end}} {{ if $st.Params.content.link_to_archive }}
    @@ -78,5 +75,4 @@
    {{ end }} -
    diff --git a/wowchemy/layouts/partials/widgets/pages.html b/wowchemy/layouts/partials/widgets/pages.html index feef304a..722e2f76 100644 --- a/wowchemy/layouts/partials/widgets/pages.html +++ b/wowchemy/layouts/partials/widgets/pages.html @@ -71,56 +71,41 @@ {{ $columns := $st.Params.design.columns | default "2" }} -
    - {{ if $st.Title }} - {{ if eq $columns "1" }} -
    - {{ with $st.Title }}

    {{.}}

    {{ end }} - {{ with $st.Params.subtitle }}

    {{ . | markdownify | emojify }}

    {{ end }} -
    - {{else}} -
    - {{ with $st.Title }}

    {{.}}

    {{ end }} - {{ with $st.Params.subtitle }}

    {{ . | markdownify | emojify }}

    {{ end }} -
    - {{end}} - {{ end }} -
    +
    - {{ with $st.Content }}{{ . }}{{ end }} + {{ with $st.Content }}{{ . }}{{ end }} - {{ range $post := $query }} - {{ if eq $st.Params.design.view 1 }} - {{ partial "li_list" . }} - {{ else if eq $st.Params.design.view 3 }} - {{ partial "li_card" . }} - {{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }} - {{ partial "li_citation" . }} - {{ else }} - {{ partial "li_compact" . }} - {{ end }} - {{end}} + {{ range $post := $query }} + {{ if eq $st.Params.design.view 1 }} + {{ partial "li_list" . }} + {{ else if eq $st.Params.design.view 3 }} + {{ partial "li_card" . }} + {{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }} + {{ partial "li_citation" . }} + {{ else }} + {{ partial "li_compact" . }} + {{ end }} + {{end}} - {{/* Archive link */}} - {{ $show_archive_link := $st.Params.content.archive.enable | default (gt $count $items_count) }} - {{ if $show_archive_link }} + {{/* Archive link */}} + {{ $show_archive_link := $st.Params.content.archive.enable | default (gt $count $items_count) }} + {{ if $show_archive_link }} - {{ $archive_link := "" }} - {{ if $st.Params.content.archive.link }} - {{ $archive_link = $st.Params.content.archive.link | relLangURL }} - {{ else }} - {{ $archive_link = $archive_page.RelPermalink }} - {{ end }} - - {{ $archive_text := $st.Params.content.archive.text | default (i18n $i18n) | default "See all" }} - - + {{ $archive_link := "" }} + {{ if $st.Params.content.archive.link }} + {{ $archive_link = $st.Params.content.archive.link | relLangURL }} + {{ else }} + {{ $archive_link = $archive_page.RelPermalink }} {{ end }} -
    + {{ $archive_text := $st.Params.content.archive.text | default (i18n $i18n) | default "See all" }} + + + {{ end }} +
    diff --git a/wowchemy/layouts/partials/widgets/tag_cloud.html b/wowchemy/layouts/partials/widgets/tag_cloud.html index 595d0759..6886d2df 100644 --- a/wowchemy/layouts/partials/widgets/tag_cloud.html +++ b/wowchemy/layouts/partials/widgets/tag_cloud.html @@ -1,5 +1,3 @@ -{{/* Pages Widget */}} - {{/* Initialise */}} {{ $ := .root }} {{ $st := .page }} @@ -18,32 +16,28 @@ {{ $tags := first $items_count (index site.Taxonomies $taxonomy).ByCount }} {{ $count := len $tags }} -
    -
    -

    {{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}

    - {{ with $st.Params.subtitle }}

    {{ . | markdownify | emojify }}

    {{ end }} -
    -
    - {{ with $st.Content }}{{ . }}{{ end }} +{{ $columns := $st.Params.design.columns | default "2" }} - {{ if ne $count 0 }} +
    + {{ with $st.Content }}{{ . }}{{ end }} - {{ $fontDelta := sub $fontBig $fontSmall }} - {{/* Warning: Hugo's `Reverse` function appears to operate in-place, hence the order of performing $max/$min matters. */}} - {{ $max := add (len (index $tags 0).Pages) 1 }} - {{ $min := len (index ($tags).Reverse 0).Pages }} - {{ $delta := sub $max $min }} - {{ $fontStep := div $fontDelta $delta }} + {{ if ne $count 0 }} -
    - {{ range $name, $term := (sort $tags ".Page.Title" "asc") }} - {{ $tagCount := len $term.Pages }} - {{ $weight := div (sub (math.Log $tagCount) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }} - {{ $fontSize := add $fontSmall (mul (sub $fontBig $fontSmall) $weight) }} - {{ .Page.Title }} - {{ end }} -
    - {{ end }} + {{ $fontDelta := sub $fontBig $fontSmall }} + {{/* Warning: Hugo's `Reverse` function appears to operate in-place, hence the order of performing $max/$min matters. */}} + {{ $max := add (len (index $tags 0).Pages) 1 }} + {{ $min := len (index ($tags).Reverse 0).Pages }} + {{ $delta := sub $max $min }} + {{ $fontStep := div $fontDelta $delta }} + +
    + {{ range $name, $term := (sort $tags ".Page.Title" "asc") }} + {{ $tagCount := len $term.Pages }} + {{ $weight := div (sub (math.Log $tagCount) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }} + {{ $fontSize := add $fontSmall (mul (sub $fontBig $fontSmall) $weight) }} + {{ .Page.Title }} + {{ end }} +
    + {{ end }} -