Compare commits

...

3 commits

Author SHA1 Message Date
George Cushen d9af47ca37 starters: update 2024-01-13 17:50:46 +00:00
George Cushen 1975d0f568 fix(tailwind): enable announcement to be hidden in Hero blox 2024-01-13 17:45:20 +00:00
George Cushen a73f8bd5b7 feat(tailwind): port navbar align option 2024-01-13 17:44:12 +00:00
6 changed files with 17 additions and 14 deletions

File diff suppressed because one or more lines are too long

View file

@ -9,17 +9,18 @@
<div class="mx-auto max-w-2xl py-32 sm:py-48 lg:py-56">
{{ with $block.content.announcement }}
{{ if $block.content.announcement.text }}
{{ $announcement := $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 class="relative rounded-full px-3 py-1 text-sm leading-6 text-gray-600 dark:text-gray-300 ring-1 ring-gray-900/10 dark:ring-gray-300 hover:ring-gray-900/20 dark:hover:ring-gray-400">
{{$announcement.text | markdownify}} {{if $announcement.link.text}}<a href="{{$announcement.link.url}}" class="font-semibold text-primary-600 dark:text-primary-300"><span class="absolute inset-0" aria-hidden="true"></span>{{$announcement.link.text}} <span aria-hidden="true">&rarr;</span></a>{{end}}
</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}}
{{ with $block.content.text }}<p class="mt-6 text-lg leading-8 text-gray-600 dark:text-gray-300">{{ . | $page.RenderString | emojify }}</p>{{end}}
{{ if $block.content.primary_action.url }}
{{ $pack := or $block.content.primary_action.icon_pack "fas" }}
@ -53,11 +54,10 @@
{{ 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}}
<a href="{{ $link_alt | safeURL }}" {{ $target_alt | safeHTMLAttr }} class="text-sm font-semibold leading-6 text-gray-900 dark:text-gray-100 hover:dark:text-gray-200 hover:text-gray-800">{{ $block.content.secondary_action.text | markdownify | emojify }} <span aria-hidden="true"></span></a>
{{end}}
</div>
{{ end }}
</div>
</div>

View file

@ -47,9 +47,11 @@
<!-- /Mobile menu -->
<!-- Main menu -->
{{ $align_menu := site.Params.header.navbar.align | default "center" }}
<ul
id="nav-menu"
class="navbar-nav order-3 hidden lg:flex w-full pb-6 lg:order-1 lg:w-auto lg:space-x-2 lg:pb-0 xl:space-x-8 justify-left">
class="navbar-nav order-3 hidden lg:flex w-full pb-6 lg:order-1 lg:w-auto lg:space-x-2 lg:pb-0 xl:space-x-8 justify-left
{{ if in (slice "l" "left") $align_menu }}mr-auto ml-6{{ else if (in (slice "r" "right") $align_menu) }}ml-auto mr-6{{end}}">
{{ $currentPage := . }}
{{ range site.Menus.main }}
{{ $menuURL := .URL | absLangURL }}

View file

@ -31,6 +31,7 @@ header:
navbar:
enable: true
blox: "navbar"
align: "center"
fixed_to_top: true
logo:
text: ""

View file

@ -20,10 +20,10 @@ sections:
text: Read the docs
url: https://docs.hugoblox.com
announcement:
text: Announcing the release of version 1.
text: "Announcing the release of version 1."
link:
text: Read more
url: /blog/
text: "Read more"
url: "/blog/"
design:
spacing:
padding: [0, 0, 0, 0]

View file

@ -4,5 +4,5 @@ go 1.19
require (
github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-netlify v1.1.2-0.20231108143325-448ed0e3bd2b
github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.1.2-0.20240103201312-35f75d5b7e3b
github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.1.2-0.20240113174520-1975d0f568ff
)