Compare commits

...

7 Commits

16 changed files with 186 additions and 36 deletions

View File

@@ -0,0 +1 @@
../../..

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env node
'use strict'
import { existsSync, mkdirSync } from 'fs'
import { copySync } from 'fs-extra/esm'
import { fileURLToPath } from 'url'
import { join, dirname } from 'node:path'
const __dirname = dirname(fileURLToPath(import.meta.url))
const fromDir = join(__dirname, '..', 'node_modules/geist/dist/fonts')
const toDir = join(__dirname, '..', 'fonts')
// Create fonts directory if it doesn't exist
if (!existsSync(toDir)) {
mkdirSync(toDir, { recursive: true })
}
// Copy geist-mono fonts
const monoFrom = join(fromDir, 'geist-mono')
const monoTo = join(toDir, 'geist-mono')
if (existsSync(monoFrom)) {
if (!existsSync(monoTo)) {
mkdirSync(monoTo, { recursive: true })
}
copySync(monoFrom, monoTo, {
dereference: true,
})
console.log(`Successfully copied geist-mono fonts`)
} else {
console.warn(`Warning: geist-mono fonts not found at ${monoFrom}`)
}
// Copy geist-sans fonts
const sansFrom = join(fromDir, 'geist-sans')
const sansTo = join(toDir, 'geist-sans')
if (existsSync(sansFrom)) {
if (!existsSync(sansTo)) {
mkdirSync(sansTo, { recursive: true })
}
copySync(sansFrom, sansTo, {
dereference: true,
})
console.log(`Successfully copied geist-sans fonts`)
} else {
console.warn(`Warning: geist-sans fonts not found at ${sansFrom}`)
}

View File

@@ -797,8 +797,8 @@ $icon-color: var(--#{$prefix}gray-400) !default;
// Code
$code-color: light-dark(var(--#{$prefix}gray-600), var(--#{$prefix}gray-400)) !default;
$code-bg: light-dark(var(--#{$prefix}gray-100), var(--#{$prefix}gray-900)) !default;
$code-font-size: $font-size-reative-sm !default;
$code-line-height: 1.25rem !default;
$code-font-size: $font-size-reative-md !default;
$code-line-height: 1.7142857em !default;
$pre-padding: 1rem !default;
$pre-bg: var(--#{$prefix}bg-surface-dark) !default;

View File

@@ -22,7 +22,7 @@
}
&.nav-pills {
margin: 0 calc(-1 * $nav-link-padding-x);
margin: 0 calc(-1 * var(--#{$prefix}nav-link-padding-x));
}
}

View File

@@ -122,7 +122,7 @@ pre {
background: $pre-bg;
color: $pre-color;
border-radius: var(--#{$prefix}border-radius);
line-height: $line-height-base;
line-height: $code-line-height;
@include scrollbar;

View File

@@ -1,6 +1,8 @@
---
title: Tabler Emails
menu-title: Emails
seoTitle: Tabler Emails - premium email templates
icon: mail
order: 4
description: Customizable email templates for over 90 clients and devices.
summary: Tabler Emails is a set of 80 eye-catching, customizable HTML templates. They are compatible with over 90 email clients and devices.

View File

@@ -1,6 +1,8 @@
---
title: Tabler Icons
menu-title: Icons
summary: Tabler Icons is a powerful and versatile icon library that offers a huge collection of high quality icons suitable for a wide range of applications. With its clean and modern aesthetic, extensive customization options, and user-friendly website and plugins, Tabler Icons is an excellent resource for designers and developers looking to enhance their projects with high-quality icons.
icon: ghost
order: 2
description: Over 5000 pixel-perfect icons for web design and development
---

View File

@@ -1,6 +1,8 @@
---
title: Tabler Illustrations
menu-title: Illustrations
order: 3
icon: paint
description: Customizable illustrations for modern web and mobile designs.
summary: Tabler Illustrations is a collection of customizable SVG illustrations for your web project. Explore our library of illustrations to enhance your web development experience.
---

View File

@@ -1,6 +1,8 @@
---
title: Tabler UI
menu-title: Admin Template
order: 1
icon: layout
description: Free and open source web application UI kit based on Bootstrap
summary: Tabler UI is a carefully crafted collection of modern and responsive user interface components. Built on top of Bootstrap, it helps developers create stunning and functional web applications quickly and efficiently.
---

View File

@@ -94,9 +94,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

@@ -2,11 +2,13 @@
:root {
--docsearch-primary-color: var(--tblr-primary);
--docsearch-searchbox-background: var(--tblr-bg-surface);
--docsearch-searchbox-focus-background: var(--tblr-bg-surface);
--docsearch-searchbox-background: var(--tblr-bg-surface-secondary);
--docsearch-searchbox-focus-background: var(--tblr-bg-surface-secondary);
--docsearch-text-color: var(--tblr-body-text);
--docsearch-key-shadow: 0 0 0 1px var(--tblr-border-color);
--docsearch-key-shadow: none;
--docsearch-key-gradient: var(--tblr-bg-surface-secondary);
--docsearch-searchbox-shadow: 0 0 0 1px var(--tblr-border-color);
--docsearch-searchbox-focus-background: var(--tblr-bg-surface-tertiary);
}
.col-docs {
@@ -24,6 +26,11 @@
box-shadow: 0 0 0 1px var(--tblr-border-color);
font-weight: var(--tblr-font-weight-normal);
transition: all 0.2s ease-in-out;
border-radius: var(--tblr-border-radius);
}
.DocSearch-Button-Placeholder {
font-size: var(--tblr-font-size);
}
.DocSearch-SearchBar {
@@ -32,6 +39,11 @@
background-color: var(--tblr-bg-surface) !important;
}
.DocSearch-Search-Icon {
width: 1rem;
height: 1rem;
}
.DocSearch-Hit-source {
background: none !important;
}
@@ -45,7 +57,7 @@
border: 1px solid var(--tblr-border-color) !important;
color: var(--tblr-body-color) !important;
box-shadow: none !important;
&:hover {
background-color: var(--tblr-bg-surface-tertiary) !important;
border-color: var(--tblr-border-color-active) !important;
@@ -88,7 +100,7 @@
.DocSearch-Input {
color: var(--tblr-body-color) !important;
&::placeholder {
color: var(--tblr-muted) !important;
}
@@ -100,8 +112,20 @@
box-shadow: none !important;
}
.DocSearch-Button-Keys {
min-width: 0;
gap: .25rem;
margin-right: .25rem;
}
.DocSearch-Button-Key {
top: 0;
box-shadow: none;
background: none;
padding: 0;
margin: 0;
width: auto;
font-size: var(--tblr-font-size);
}
.DocSearch-Container {
@@ -114,13 +138,13 @@
}
}
.example > .modal,
.example > .offcanvas {
.example>.modal,
.example>.offcanvas {
display: block !important;
position: relative !important;
}
.example > .offcanvas-backdrop {
.example>.offcanvas-backdrop {
position: absolute !important;
}
@@ -133,4 +157,4 @@ code {
::selection {
background: var(--tblr-primary);
}
}
}

View File

@@ -1,5 +1,12 @@
{
"trailingSlash": false,
"redirects": [
{
"source": "/",
"destination": "/ui",
"permanent": false
}
],
"rewrites": [
{
"source": "/stats/js/script.js",
@@ -17,6 +24,7 @@
"source": "/eat/:path(.*)",
"destination": "https://eu.i.posthog.com/:path*"
},
{
"source": "/(.*)",
"destination": "/error-404.html"

View File

@@ -35,6 +35,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);
});
@@ -144,6 +152,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 %}
{% 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 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>
</nav>
{% endif %}

View File

@@ -1,7 +1,7 @@
<div class="navbar navbar-expand sticky-top">
<div class="container">
<div class="row flex-fill align-items-md-center">
<div class="col">
<div class="col-auto">
<div class="d-flex align-items-center gap-4">
<a href="{{ page.url | relative }}" class="navbar-brand navbar-brand-autodark gap-4">
{% include "docs/logo.html" %}
@@ -11,7 +11,7 @@
</div>
</div>
</div>
<div class="d-none d-md-block col">
<div class="d-none d-md-block col-3">
<div id="docsearch"></div>
</div>
<div class="col d-flex">
@@ -46,4 +46,42 @@
</div>
</div>
</div>
</div>
{% assign menu = collections.docs | collection-tree %}
<div class="navbar-expand-md">
<div class="container">
<div class="navbar">
<div class="row flex-column flex-md-row flex-fill align-items-center">
<div class="col">
<nav>
<ul class="navbar-nav">
{% for level1 in menu %}
<li class="nav-item{% if page.url contains level1.url %} active{% endif %}">
<a href="{{ level1.url }}" class="nav-link">
{% if level1.data.icon %}<span class="nav-link-icon">{% include "ui/icon.html" icon=level1.data.icon %}</span>{% endif %}
<span class="nav-link-title">{{ level1.data.menu-title }}</span>
</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
<div class="col-auto">
<nav>
<ul class="navbar-nav">
{% for link in docs-links %}
<li class="nav-item">
<a href="{{ link.url }}" class="nav-link" target="_blank">
<span class="nav-link-icon">{% include "ui/icon.html" icon=link.icon %}</span>
<span class="nav-link-title">{{ link.title }}</span>
</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>

View File

@@ -81,7 +81,7 @@
<link rel="stylesheet" href="/css/docs{% if environment != 'development' %}.min{% endif %}.css" />
</head>
<body class="d-flex flex-column" style="background: var(--tblr-bg-surface)">
<body class="d-flex flex-column bg-surface">
<script src="/dist/js/tabler-theme{% if environment != 'development' %}.min{% endif %}.js"></script>
<!-- BEGIN NAVBAR -->
<header role="banner">
@@ -93,16 +93,8 @@
<div class="container">
<div class="row g-0">
<div class="col-docs d-none d-lg-block border-end">
<div class="py-4">
<div class="py-4 pe-2">
<div class="space-y space-y-5">
<div class="nav nav-vertical">
{% for link in docs-links %}
<a href="{{ link.url }}" class="nav-link" target="_blank">
<span class="border me-2 rounded p-1">{% include "ui/icon.html" icon=link.icon %}</span>
{{ link.title }}
</a>
{% endfor %}
</div>
<div class="flex-fill">
{% include "docs/menu.html" %}
</div>