fix FAQ shortcode: use ~~~ separator, function-style split, trim whitespace
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
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
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>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
{{/* FAQ shortcode — renders as expandable details + outputs FAQPage schema for AI search */}}
|
||||
{{ $items := .Inner | split "---" }}
|
||||
{{ $raw := .Inner }}
|
||||
{{ $items := split $raw "~~~" }}
|
||||
<div class="faq-section">
|
||||
{{ range $items }}
|
||||
{{ $parts := . | split "?" }}
|
||||
{{ $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>
|
||||
@@ -10,4 +13,5 @@
|
||||
</details>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user