Skip to content

Commit

Permalink
feat: port Hero blox
Browse files Browse the repository at this point in the history
  • Loading branch information
gcushen committed Nov 24, 2023
1 parent fef14e4 commit 00b9ae5
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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\"" }}
Expand All @@ -107,7 +107,7 @@
<a href="{{.url}}" target="_blank" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-lg hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"><svg class="w-3.5 h-3.5 me-2.5" aria-hidden="true" xmlns="http:https://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M14.707 7.793a1 1 0 0 0-1.414 0L11 10.086V1.5a1 1 0 0 0-2 0v8.586L6.707 7.793a1 1 0 1 0-1.414 1.414l4 4a1 1 0 0 0 1.416 0l4-4a1 1 0 0 0-.002-1.414Z"/>
<path d="M18 12h-2.55l-2.975 2.975a3.5 3.5 0 0 1-4.95 0L4.55 12H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2Zm-3 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/>
</svg> {{.label}}</a>
</svg> {{.text}}</a>
{{ end }}

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{ end }}
</div>
<div class="flex justify-center items-center font-semibold w-full text-gray-700 -ml-10">
{{ .title | markdownify | emojify }}
{{ .text | markdownify | emojify }}
</div>
</div>
</a>
Expand Down
4 changes: 2 additions & 2 deletions modules/blox-tailwind/layouts/partials/blox/experience.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h3 class="flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-
<a href="{{.url}}" target="_blank" rel="noopener" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-lg hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"><svg class="w-3.5 h-3.5 me-2.5" aria-hidden="true" xmlns="http:https://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M14.707 7.793a1 1 0 0 0-1.414 0L11 10.086V1.5a1 1 0 0 0-2 0v8.586L6.707 7.793a1 1 0 1 0-1.414 1.414l4 4a1 1 0 0 0 1.416 0l4-4a1 1 0 0 0-.002-1.414Z"/>
<path d="M18 12h-2.55l-2.975 2.975a3.5 3.5 0 0 1-4.95 0L4.55 12H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2Zm-3 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/>
</svg> {{.label}}</a>
</svg> {{.text}}</a>
{{ end }}

</li>
Expand Down Expand Up @@ -94,7 +94,7 @@ <h3 class="flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-
<a href="{{.url}}" target="_blank" rel="noopener" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-lg hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"><svg class="w-3.5 h-3.5 me-2.5" aria-hidden="true" xmlns="http:https://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M14.707 7.793a1 1 0 0 0-1.414 0L11 10.086V1.5a1 1 0 0 0-2 0v8.586L6.707 7.793a1 1 0 1 0-1.414 1.414l4 4a1 1 0 0 0 1.416 0l4-4a1 1 0 0 0-.002-1.414Z"/>
<path d="M18 12h-2.55l-2.975 2.975a3.5 3.5 0 0 1-4.95 0L4.55 12H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2Zm-3 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/>
</svg> {{.label}}</a>
</svg> {{.text}}</a>
{{ end }}

</li>
Expand Down
65 changes: 65 additions & 0 deletions modules/blox-tailwind/layouts/partials/blox/hero.html
Original file line number Diff line number Diff line change
@@ -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 }}
<div class="relative isolate px-6 pt-14 lg:px-8">

<div class="mx-auto max-w-2xl py-32 sm:py-48 lg:py-56">

{{ with $block.content.announcement }}
<div class="hidden sm:mb-8 sm:flex sm:justify-center">
<div class="relative rounded-full px-3 py-1 text-sm leading-6 text-gray-600 dark:text-gray-400 ring-1 ring-gray-900/10 dark:ring-gray-100/10 hover:ring-gray-900/20">
{{.text | markdownify}} {{with .link}}<a href="{{.url}}" class="font-semibold text-primary-600 dark:text-primary-400"><span class="absolute inset-0" aria-hidden="true"></span>{{.text}} <span aria-hidden="true">&rarr;</span></a>
</div>
</div>
{{end}}

<div class="text-center">
{{ with $block.content.title }}<h1 class="text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100 sm:text-6xl">{{ . | markdownify }}</h1>{{end}}
{{ with $block.content.text }}<p class="mt-6 text-lg leading-8 text-gray-600 dark:text-gray-400">{{ . | $page.RenderString | emojify }}</p>{{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 }}
<div class="mt-10 flex items-center justify-center gap-x-6">
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} class="rounded-md bg-primary-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600">
{{ $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 }}
</a>
{{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 }}
<a href="{{ $link_alt | safeURL }}" {{ $target_alt | safeHTMLAttr }} class="text-sm font-semibold leading-6 text-gray-900 dark:text-gray-100">{{ $block.content.secondary_action.text | markdownify | emojify }} <span aria-hidden="true"></span></a>
{{end}}

</div>
{{ end }}

</div>
</div>

</div>
2 changes: 1 addition & 1 deletion starters/academic-cv/.github/workflows/updater-wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 00b9ae5

Please sign in to comment.