diff --git a/content/_index.md b/content/_index.md index 13fef045eb41..fa5a3ed70d97 100644 --- a/content/_index.md +++ b/content/_index.md @@ -10,6 +10,10 @@ sections: layout: split cta_secondary_text: Download open source cta_secondary_link: /docs/install/ + cta_card_label: For humans + cta_agent_label: For agents + cta_agent_prompt: Fetch https://www.pulumi.com/onboard.md and follow its instructions to get me started with Pulumi. + cta_agent_prompt_label: Copy prompt badge_highlight_text: "Latest release:" badge_text: "Full support for Terraform and HCL" badge_link: /releases/terraform-state-backend-modules-hcl/ diff --git a/layouts/partials/hero-ctas.html b/layouts/partials/hero-ctas.html new file mode 100644 index 000000000000..387d23d34f68 --- /dev/null +++ b/layouts/partials/hero-ctas.html @@ -0,0 +1,70 @@ +{{/* + Hero CTA row — shared by the split and centered branches of template-hero. + + By default this renders the primary/secondary/tertiary buttons in a plain + flex row, exactly as before. Setting cta_card_label groups them into a + bordered card whose label straddles the top border, and setting + cta_agent_prompt adds a second card beside it holding a single + copy-to-clipboard button for coding agents. + + Params: + - cta_primary_text / cta_primary_link + - cta_secondary_text / cta_secondary_link + - cta_tertiary_text / cta_tertiary_link + - cta_card_label: Optional. Label for the card wrapping the buttons (e.g. "For humans"). + - cta_agent_label: Optional. Label for the agent card. Defaults to "For agents". + - cta_agent_prompt: Optional. Text the agent card's button copies to the clipboard. + - cta_agent_prompt_label: Optional short text shown on that button in place of the + full prompt. The prompt itself is still what gets copied, and still what the + tooltip shows. Defaults to the prompt. + - layout: "split" (buttons go inline at sm) or "centered" (at lg). + + Class strings below are written out in full rather than composed from + fragments so Tailwind's source scanner still sees every utility. +*/}} + +{{ $split := eq (.layout | default "centered") "split" }} +{{ $rowClass := cond $split "flex flex-col sm:flex-row flex-wrap items-start gap-4 w-full" "flex flex-col lg:flex-row flex-wrap items-center justify-center gap-4 w-full" }} +{{ $btnClass := cond $split "w-full sm:w-auto" "w-full lg:w-auto" }} +{{ $cardLabel := .cta_card_label }} +{{ $agentLabel := .cta_agent_label | default "For agents" }} +{{ $agentPrompt := .cta_agent_prompt }} +{{ $agentPromptLabel := .cta_agent_prompt_label | default $agentPrompt }} + +{{ if or .cta_primary_text .cta_secondary_text .cta_tertiary_text }} +
{{ $description | markdownify }}
{{ end }} - {{ if or $ctaPrimaryText $ctaSecondaryText $ctaTertiaryText }} -{{ $description | markdownify }}
{{ end }} - {{ if or $ctaPrimaryText $ctaSecondaryText $ctaTertiaryText }} -