Skip to content

Commit 487f047

Browse files
hautenbecker33
authored andcommitted
add accordion template
1 parent 118f5cf commit 487f047

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

about/contributing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ The informational pages on this site (e.g., this page, [About](/about), [FAQ](/a
170170

171171
**To create an accordion slug:** Accordion titles automatically generate a unique URL hash so the user can go directly to an expanded accordion using a unique URL. As an accordion's title is often lengthy question text, a shortened slug can be used to shorten the URL hash. For example, this accordion's title is `How do I update the FAQ or other text?` but the hash is the much shorter `#faq`. Add `slug='unique-hash'` after the `title` in the accordion's `include` syntax. Slugs should be unique to the page they're on; in other words, a page should not have two accordions with the same slug.
172172

173+
Here is a template for creating a new accordion. Somewhat unintuitively, the title of the accordion appears *below* its contents.
174+
175+
```liquid
176+
{% raw %}
177+
{% capture accordionContent %}
178+
179+
Text/content goes here
180+
181+
{% endcapture %}
182+
{% assign accordionContent = accordionContent | markdownify %}
183+
{% include components/accordion.html title='Title of the FAQ in the form of a question?' slug='unique-hash' content=accordionContent %}
184+
{% endraw %}
185+
```
186+
173187
{% endcapture %}
174188
{% assign accordionContent = accordionContent | markdownify %}
175189
{% include components/accordion.html title='How do I update the FAQ or other text?' slug='faq' content=accordionContent %}

0 commit comments

Comments
 (0)