hextra icon indicating copy to clipboard operation
hextra copied to clipboard

Implement hextra/hero-section, defining a h2 heading on front-page

Open fmunteanu opened this issue 1 year ago • 9 comments

Feature Description

Hi @imfing,

On Hextra front-page, I need the ability to insert a h2 heading, defining additional section titles. For example, adding a subtitle above hextra/feature-grid.

Proposed Solution

I created the following layouts/shortcodes/hextra/hero-section.html shortcode, implementing a section:

{{- $style := .Get "style" -}}

<h2
  class="not-prose hx-text-4xl hx-font-bold hx-leading-none hx-tracking-tighter md:hx-text-3xl hx-py-2 hx-bg-clip-text hx-text-transparent hx-bg-gradient-to-r hx-from-gray-900 hx-to-gray-600 dark:hx-from-gray-100 dark:hx-to-gray-400"
  {{ with $style }}style="{{ . | safeCSS }}"{{ end }}
>
  {{ .Inner | markdownify }}
</h2>

Code Usage

Example of hextra/hero-section shortcode usage:

<div class="hx-mt-6 hx-mb-6">
{{< hextra/hero-section >}}
  Used Technologies
{{< /hextra/hero-section >}}
</div>

Implementation Result

Note the Used Technologies section title, above the hextra/feature-grid:

image

fmunteanu avatar May 08 '24 20:05 fmunteanu

Hi!

Could you please provide a code that you use for a big picture in a hero section?

Thanks.

mafendi avatar May 09 '24 02:05 mafendi

@mafendi see #387.

fmunteanu avatar May 09 '24 02:05 fmunteanu

@mafendi see #387.

Thanks! 😊

mafendi avatar May 09 '24 02:05 mafendi

I think these two hero features are very useful for the front-page and should be implemented.

fmunteanu avatar May 09 '24 03:05 fmunteanu

@fmunteanu Can you send PRs for these? thank you

imfing avatar May 16 '24 23:05 imfing

@imfing will do, thank you for considering it!

fmunteanu avatar May 16 '24 23:05 fmunteanu

@imfing I implemented header size in #390. Is a nice addition to original feature.

fmunteanu avatar May 17 '24 19:05 fmunteanu

@mafendi https://github.com/imfing/hextra/pull/389 was merged into main branch, see the PR description for the updated code usage.

@imfing can we please have #390 merged also?

fmunteanu avatar May 24 '24 19:05 fmunteanu

@mafendi https://github.com/imfing/hextra/pull/389 was merged into main branch, see the PR description for the updated code usage.

@imfing can we please have #390 merged also?

Great, thanks a lot 👍

mafendi avatar May 24 '24 20:05 mafendi