From 00b9ae543179291224b93a7c857562b708121080 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Fri, 24 Nov 2023 23:16:21 +0000 Subject: [PATCH] feat: port Hero blox --- .../{about.avatar.html => biography.html} | 6 +- .../{buttons.html => cta-button-list.html} | 2 +- .../layouts/partials/blox/experience.html | 4 +- .../layouts/partials/blox/hero.html | 65 +++++++++++++++++++ .../.github/workflows/updater-wip.yml | 2 +- 5 files changed, 72 insertions(+), 7 deletions(-) rename modules/blox-tailwind/layouts/partials/blox/{about.avatar.html => biography.html} (97%) rename modules/blox-tailwind/layouts/partials/blox/{buttons.html => cta-button-list.html} (95%) create mode 100644 modules/blox-tailwind/layouts/partials/blox/hero.html diff --git a/modules/blox-tailwind/layouts/partials/blox/about.avatar.html b/modules/blox-tailwind/layouts/partials/blox/biography.html similarity index 97% rename from modules/blox-tailwind/layouts/partials/blox/about.avatar.html rename to modules/blox-tailwind/layouts/partials/blox/biography.html index e4d9a074f..065bb87b6 100644 --- a/modules/blox-tailwind/layouts/partials/blox/about.avatar.html +++ b/modules/blox-tailwind/layouts/partials/blox/biography.html @@ -77,11 +77,11 @@ {{ if in (slice "fab" "fas" "far" "fal") $pack }} {{ $pack_prefix = "fa" }} {{ end }} - {{ $link := .link }} + {{ $link := .url | default .link }} {{ $scheme := (urls.Parse $link).Scheme }} {{ $target := "" }} {{ if not $scheme }} - {{ $link = .link | relLangURL }} + {{ $link = (.url | default .link) | relLangURL }} {{ if eq (path.Ext $link) ".pdf" }}{{ $target = "target=\"_blank\" rel=\"noopener\"" }}{{ end }} {{ else if in (slice "http" "https") $scheme }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} @@ -107,7 +107,7 @@ {{.label}} + {{.text}} {{ end }} diff --git a/modules/blox-tailwind/layouts/partials/blox/buttons.html b/modules/blox-tailwind/layouts/partials/blox/cta-button-list.html similarity index 95% rename from modules/blox-tailwind/layouts/partials/blox/buttons.html rename to modules/blox-tailwind/layouts/partials/blox/cta-button-list.html index 7e1e81a5b..ce1f1c7ba 100644 --- a/modules/blox-tailwind/layouts/partials/blox/buttons.html +++ b/modules/blox-tailwind/layouts/partials/blox/cta-button-list.html @@ -17,7 +17,7 @@ {{ end }}
- {{ .title | markdownify | emojify }} + {{ .text | markdownify | emojify }}
diff --git a/modules/blox-tailwind/layouts/partials/blox/experience.html b/modules/blox-tailwind/layouts/partials/blox/experience.html index 1f0dcc0e7..8a64248b1 100644 --- a/modules/blox-tailwind/layouts/partials/blox/experience.html +++ b/modules/blox-tailwind/layouts/partials/blox/experience.html @@ -55,7 +55,7 @@

{{.label}} + {{.text}} {{ end }} @@ -94,7 +94,7 @@

{{.label}} + {{.text}} {{ end }} diff --git a/modules/blox-tailwind/layouts/partials/blox/hero.html b/modules/blox-tailwind/layouts/partials/blox/hero.html new file mode 100644 index 000000000..c426b789e --- /dev/null +++ b/modules/blox-tailwind/layouts/partials/blox/hero.html @@ -0,0 +1,65 @@ +{{/* Hugo Blox: Hero */}} +{{/* Documentation: https://hugoblox.com/blocks/ */}} +{{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +
+ +
+ + {{ with $block.content.announcement }} + + {{end}} + +
+ {{ with $block.content.title }}

{{ . | markdownify }}

{{end}} + {{ with $block.content.text }}

{{ . | $page.RenderString | emojify }}

{{end}} + + {{ if $block.content.primary_action.url }} + {{ $pack := or $block.content.primary_action.icon_pack "fas" }} + {{ $pack_prefix := $pack }} + {{ if in (slice "fab" "fas" "far" "fal") $pack }} + {{ $pack_prefix = "fa" }} + {{ end }} + {{ $link := $block.content.primary_action.url }} + {{ $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 }} +
+ + {{ $block.content.primary_action.text | markdownify | emojify }} + {{ with $block.content.primary_action.icon }} + {{ partial "functions/get_icon" (dict "name" . "attributes" "style=\"height: 1em\" class='inline-block pl-2'") }} + {{ end }} + + {{end}} + + {{ if $block.content.secondary_action.url }} + {{ $link_alt := $block.content.secondary_action.url }} + {{ $scheme_alt := (urls.Parse $link_alt).Scheme }} + {{ $target_alt := "" }} + {{ if not $scheme_alt }} + {{ $link_alt = $link_alt | relLangURL }} + {{ else if in (slice "http" "https") $scheme_alt }} + {{ $target_alt = "target=\"_blank\" rel=\"noopener\"" }} + {{ end }} + {{ $block.content.secondary_action.text | markdownify | emojify }} + {{end}} + +
+ {{ end }} + +
+
+ +
diff --git a/starters/academic-cv/.github/workflows/updater-wip.yml b/starters/academic-cv/.github/workflows/updater-wip.yml index bd1f636df..e385017fc 100644 --- a/starters/academic-cv/.github/workflows/updater-wip.yml +++ b/starters/academic-cv/.github/workflows/updater-wip.yml @@ -11,6 +11,6 @@ jobs: steps: - uses: HugoBlox/gh-action-updater@v1 with: - feed-url: https://hugoblox.com/blog/index.xml + feed-url: https://hugoblox.com/rss.xml readme-section: news branch: main