diff --git a/docs/.eleventy.js b/docs/.eleventy.js index 22c8dc27b..4026acc68 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -39,6 +39,7 @@ export default function (eleventyConfig) { // With Prettier 3, this means a leading pipe will exist be present when the line wraps. return typeof content === 'string' ? content.replace(/^(\s|\|)/g, '').replace(/(\s|\|)$/g, '') : content; }); + eleventyConfig.addFilter('keys', obj => Object.keys(obj)); // Shortcodes - {% shortCode arg1, arg2 %} eleventyConfig.addShortcode('cdnUrl', location => { diff --git a/docs/docs/components/reference.njk b/docs/docs/components/reference.njk index cf7b333c4..8d3779130 100644 --- a/docs/docs/components/reference.njk +++ b/docs/docs/components/reference.njk @@ -9,8 +9,40 @@ table code { } + + + {% for type, all in componentsBy -%} -

All {{ "CSS custom properties" if type == "cssProperty" else ("CSS parts" if type == "cssPart" else (type | title) + "s") }}

+{% set typeTitle = "CSS custom properties" if type == "cssProperty" else ("CSS parts" if type == "cssPart" else (type | title) + "s") %} +

+ All {{ (all | keys).length }} + {{ typeTitle }} +