feat: FaqBlock layer for the SummerCMS FAQ API
- typed client and useFaq/useFaqApi (SSR, faq:<slug>:<locale> key, server and public bases, x-forwarded-for forwarded also on cached renders) - FaqBlock, FaqList and FaqItem: native details, exclusive and openFirst, server-sanitized description and answers, nothing or #fallback on 404, error or no items - FAQ tokens and base CSS with the .faq-html rules, README - node client tests and a playground SSR smoke against a fixture API
This commit is contained in:
12
testing/fixtures/faqs/acme.json
Normal file
12
testing/fixtures/faqs/acme.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"data": {
|
||||
"name": "Acme questions",
|
||||
"slug": "acme",
|
||||
"locale": "en",
|
||||
"description": "<p>Answers about <a href=\"https://acme.example.test/\">Acme</a>.</p>",
|
||||
"content": [
|
||||
{ "question": "How long does shipping take?", "answer": "<p>Two days.</p><ul><li>Poland</li><li>Europe</li></ul>" },
|
||||
{ "question": "Can I return an order?", "answer": "<p>Within 14 days.</p>" }
|
||||
]
|
||||
}
|
||||
}
|
||||
1
testing/fixtures/faqs/empty.json
Normal file
1
testing/fixtures/faqs/empty.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "data": { "name": "Empty", "slug": "empty", "locale": "en", "description": null, "content": [] } }
|
||||
Reference in New Issue
Block a user