Files
internetforkids/layouts/shortcodes/faq.html
Christian Gick ed8d0b03a9
All checks were successful
Deploy Internet for Kids / Build & Push (push) Successful in 14s
Deploy Internet for Kids / Deploy (push) Successful in 6s
Deploy Internet for Kids / Health Check (push) Successful in 2s
Deploy Internet for Kids / Smoke Tests (push) Successful in 3s
Deploy Internet for Kids / IndexNow Ping (push) Successful in 8s
Deploy Internet for Kids / Promote to Latest (push) Successful in 2s
Deploy Internet for Kids / Rollback (push) Has been skipped
Deploy Internet for Kids / Audit (push) Successful in 1s
fix FAQ shortcode: use ~~~ separator, function-style split, trim whitespace
Hugo strips --- (interprets as thematic break) from shortcode .Inner content.
Switch to ~~~ separator. Also fix split syntax (function-style instead of pipe)
and add trim to handle whitespace around items.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:14:13 +03:00

18 lines
715 B
HTML

{{/* FAQ shortcode — renders as expandable details + outputs FAQPage schema for AI search */}}
{{ $raw := .Inner }}
{{ $items := split $raw "~~~" }}
<div class="faq-section">
{{ range $items }}
{{ $trimmed := trim . "\n\r\t " }}
{{ if $trimmed }}
{{ $parts := split $trimmed "?" }}
{{ if gt (len $parts) 1 }}
<details class="faq-item" style="margin-bottom: 0.75rem; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0;">
<summary style="padding: 0.75rem 1rem; cursor: pointer; font-weight: 600; list-style: none;">{{ index $parts 0 | markdownify }}?</summary>
<div style="padding: 0 1rem 0.75rem; color: #4a5568;">{{ index $parts 1 | markdownify }}</div>
</details>
{{ end }}
{{ end }}
{{ end }}
</div>