Skip to content

Commit

Permalink
- Added content category (principle/standard/pattern) to docs
Browse files Browse the repository at this point in the history
- Added `displayContentCategory` to content document list macro - allows category to be displayed in collection view
- Displaying content category in tag page
  • Loading branch information
keithkennedyHO committed Nov 6, 2023
1 parent 7809ac2 commit fed00b1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion _includes/layouts/tag.njk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
{{ documentList.contentDocumentList({
headingLevel: 3 if paginationHeading else 2,
classes: "app-document-list--large",
items: collections[tag] | orderPagesByTitle
items: collections[tag] | orderPagesByTitle,
displayContentCategory: true
}) }}

{{ appProseScope(content) if content }}
Expand Down
7 changes: 6 additions & 1 deletion _includes/macros/contentDocumentList.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
{% endif %}
{% if item.data.date or item.data.tags %}
<ul class="app-document-list__item-metadata">
{% if params.displayContentCategory === true and item.data.category %}
<li class="app-document-list__attribute">
{{ item.data.category }}
</li>
{% endif %}
{% if item.data.id %}
<li class="app-document-list__attribute">
{{ item.data.id }}
Expand All @@ -35,4 +40,4 @@
<p class="govuk-body">No documents found.</p>
{% endif %}

{% endmacro %}
{% endmacro %}
1 change: 1 addition & 0 deletions docs/patterns/patterns.11tydata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
tags: [],
category: 'Pattern',
eleventyComputed: {
viewSource: data => `./docs${data.page.filePathStem}.md?plain=1`
},
Expand Down
1 change: 1 addition & 0 deletions docs/principles/principles.11tydata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
tags: [],
category: 'Principle',
eleventyComputed: {
viewSource: data => `./docs${data.page.filePathStem}.md?plain=1`
},
Expand Down
1 change: 1 addition & 0 deletions docs/standards/standards.11tydata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
tags: [],
category: 'Standard',
eleventyComputed: {
viewSource: data => `./docs${data.page.filePathStem}.md?plain=1`
},
Expand Down

0 comments on commit fed00b1

Please sign in to comment.