Skip to content

Commit

Permalink
Allow details component to be called (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood authored Jul 16, 2024
1 parent 9e6ebc7 commit 647ed2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added `itemHeadingLevel` to file list component and changed file titles to headings
- The contents of the details element can be [called in Nunjucks](https://mozilla.github.io/nunjucks/templating.html#call)

### Changed

Expand Down
4 changes: 3 additions & 1 deletion src/nationalarchives/components/details/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<details class="tna-details__details"{%- if params.open %} open{% endif %}>
<summary class="tna-details__summary">{{ params.title }}</summary>
<div class="tna-details__content">
{%- if params.text %}
{%- if caller %}
{{ caller() }}
{%- elif params.text %}
<p>{{ params.text }}</p>
{%- else %}
{{ params.body | safe }}
Expand Down

0 comments on commit 647ed2c

Please sign in to comment.