From 5c8a98788c89dbb86bc6ed96aa1934c8c94e5192 Mon Sep 17 00:00:00 2001 From: codecalm Date: Mon, 24 Nov 2025 23:11:04 +0100 Subject: [PATCH] Update icon counts, enhance menu navigation, and add new filters --- docs/content/icons/index.md | 2 +- docs/eleventy.config.mjs | 6 +++--- shared/e11ty/filters.mjs | 13 +++++++++++++ shared/includes/docs/menu.html | 27 +++++++++++++++++++-------- vercel.json | 10 ++++++++++ 5 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 vercel.json diff --git a/docs/content/icons/index.md b/docs/content/icons/index.md index d0990cd79..b4c1338ff 100644 --- a/docs/content/icons/index.md +++ b/docs/content/icons/index.md @@ -10,5 +10,5 @@ description: Over 5000 pixel-perfect icons for web design and development Tabler Icons is a comprehensive icon library that features {{ iconsCount }} high-quality icons. These icons are designed with a clean and modern aesthetic, making them suitable for a wide range of applications. -To use Tabler Icons, you can visit their website at https://tabler-icons.io. From there, you can browse the full collection of icons by category or search for a specific icon using the search bar. Once you have found an icon you like, you can download it in various file formats, including SVG, PNG, and Icon Font. +To use Tabler Icons, you can visit their website at [Tabler Icons Official Website]({{ site.icons.link }}). From there, you can browse the full collection of icons by category or search for a specific icon using the search bar. Once you have found an icon you like, you can download it in various file formats, including SVG, PNG, and Icon Font. diff --git a/docs/eleventy.config.mjs b/docs/eleventy.config.mjs index 5062b3fdc..d21ae8a92 100644 --- a/docs/eleventy.config.mjs +++ b/docs/eleventy.config.mjs @@ -274,9 +274,9 @@ export default function (eleventyConfig) { eleventyConfig.addGlobalData("posthogHost", process.env.POSTHOG_HOST || "https://us.i.posthog.com"); const data = { - iconsCount: () => 123, - emailsCount: () => 123, - illustrationsCount: () => 123 + iconsCount: () => 5963, + emailsCount: () => 80, + illustrationsCount: () => 105 }; for (const [key, value] of Object.entries(data)) { diff --git a/shared/e11ty/filters.mjs b/shared/e11ty/filters.mjs index 1765f0894..667ca8a38 100644 --- a/shared/e11ty/filters.mjs +++ b/shared/e11ty/filters.mjs @@ -29,6 +29,14 @@ export function appFilters(eleventyConfig) { .replace(/[\r\n]/g, ' '); }); + eleventyConfig.addFilter("strip_trailing_slash", (text) => { + return text?.replace(/\/$/, ''); + }); + + eleventyConfig.addFilter("strip_leading_slash", (text) => { + return text?.replace(/^\//, ''); + }); + eleventyConfig.addFilter("contains", (items, item) => { return items && Array.isArray(items) && items.includes(item); }); @@ -138,6 +146,11 @@ export function appFilters(eleventyConfig) { return 0; }) + eleventyConfig.addFilter("debug", function (elem) { + console.log(elem); + return elem; + }) + eleventyConfig.addFilter("first", function (elem) { if (elem instanceof Object) { return elem[Object.keys(elem)[0]]; diff --git a/shared/includes/docs/menu.html b/shared/includes/docs/menu.html index 25d1b27f9..3063a33d5 100644 --- a/shared/includes/docs/menu.html +++ b/shared/includes/docs/menu.html @@ -1,22 +1,33 @@ {% assign menu = collections.docs | collection-tree %} +{% assign current-section = page.url | split: '/' | slice: 1, 1 | prepend: '/' | append: '/' %} +{% for level1 in menu %} +{% if current-section == level1.url %} +{% assign current-menu = level1.children %} +{% endif %} +{% endfor %} +{% if current-menu %} \ No newline at end of file + +{% endif %} \ No newline at end of file diff --git a/vercel.json b/vercel.json new file mode 100644 index 000000000..a9ad2b316 --- /dev/null +++ b/vercel.json @@ -0,0 +1,10 @@ +{ + "redirects": [ + { + "source": "/", + "destination": "/ui", + "permanent": false + } + ] +} +