1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

Update icon counts, enhance menu navigation, and add new filters

This commit is contained in:
codecalm
2025-11-24 23:11:04 +01:00
parent 2a474ef935
commit 5c8a98788c
5 changed files with 46 additions and 12 deletions

View File

@@ -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.

View File

@@ -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)) {

View File

@@ -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]];

View File

@@ -1,22 +1,33 @@
{% assign menu = collections.docs | collection-tree %}
<nav class="space-y space-y-5" id="menu">
{% 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 %}
<nav class="space-y space-y-5" id="menu">
{% for level1 in current-menu %}
<div>
<div class="subheader mb-2">
{{ level1.data.title }}
</div>
{% if level1.children %}
<nav class="nav nav-vertical">
{% for level2 in level1.children %}
<div>
<a class="nav-link{% if page.url contains level2.url %} active{% endif %}"{% if level2.children %} href="{{ level2.url }}" data-bs-toggle="collapse" data-bs-target="#collapse-{{ level2.url | slug }}" aria-expanded="{% if page.url contains level2.url %}true{% else %}false{% endif %}"{% endif %}>{{ level2.data.title }}{% if level2.children %} <span class="nav-link-toggle"></span>{% endif %}</a>
<a class="nav-link{% if page.url contains level2.url %} active{% endif %}" {% if level2.children %}
href="{{ level2.url }}" data-bs-toggle="collapse" data-bs-target="#collapse-{{ level2.url | slug }}"
aria-expanded="{% if page.url contains level2.url %}true{% else %}false{% endif %}" {% endif
%}>{{ level2.data.title }}{% if level2.children %} <span class="nav-link-toggle"></span>{% endif %}</a>
{% if level2.children %}
<nav class="nav nav-vertical collapse{% if page.url contains level2.url %} show{% endif %}" id="collapse-{{ level2.url | slug }}">
<nav class="nav nav-vertical collapse{% if page.url contains level2.url %} show{% endif %}"
id="collapse-{{ level2.url | slug }}">
{% for level3 in level2.children %}
<div>
<a class="nav-link{% if page.url == level3.url %} active{% endif %}" href="{{ level3.url }}">{{ level3.data.title }}</a>
<a class="nav-link{% if page.url == level3.url %} active{% endif %}"
href="{{ level3.url }}">{{ level3.data.title }}</a>
</div>
{% endfor %}
</nav>
@@ -24,7 +35,7 @@
</div>
{% endfor %}
</nav>
{% endif %}
</div>
{% endfor %}
</nav>
{% endif %}

10
vercel.json Normal file
View File

@@ -0,0 +1,10 @@
{
"redirects": [
{
"source": "/",
"destination": "/ui",
"permanent": false
}
]
}