Skip to content

Commit

Permalink
docs: fix element listing titles (#947)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Apr 26, 2023
1 parent a38ab8f commit 2ae8a7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/_plugins/rhds.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ module.exports = function(eleventyConfig, { tagsToAlphabetize }) {

eleventyConfig.addTransform('demo-lightdom-css', lightdomCss);

eleventyConfig.addFilter('getTitleFromDocs', function(docs) {
return docs.find(x => x.docsPage?.title)?.docsPage?.title ??
docs[0]?.docsPage?.title ??
eleventyConfig.getFilter('deslugify')(docs[0]?.slug);
});

/** get the element overview from the manifest */
eleventyConfig.addFilter('getElementDescription', function getElementDescription(tagName) {
/**
Expand Down
2 changes: 1 addition & 1 deletion docs/elements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ summaries:
alt=linkTitle,
src=doc.screenshotPath %}
</a>
<h3>{{ doc.title }}</h3>
<h3>{{ docs | getTitleFromDocs }}</h3>
<p>{{ summary }}</p>
</div>
{% endfor %}
Expand Down

0 comments on commit 2ae8a7d

Please sign in to comment.