Skip to content

Commit ed886a8

Browse files
committed
mf
1 parent 1c53189 commit ed886a8

6 files changed

Lines changed: 20 additions & 124 deletions

File tree

static/js/shell-config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
window.SiteNavConfig = {
2+
// Navigation
3+
nav: [],
4+
sidebarNav: [],
5+
6+
// Chrome
7+
showSearch: false,
8+
showAppsGrid: true,
9+
showThemeToggle: true,
10+
};

static/js/shell.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,22 @@
1313
* <script src="https://dhanur.me/js/shell.js" defer></script>
1414
*
1515
* Configuration (set before this script loads):
16-
* <script>
16+
* Create a file `js/shell-config.js`:
1717
* window.SiteNavConfig = {
1818
* nav: [
1919
* { name: "Home", url: "/", icon: "fa-solid fa-house" },
2020
* { name: "Docs", url: "/docs/", icon: "fa-solid fa-book" }
2121
* ],
2222
* activePath: "/docs/",
23-
* logo: {
24-
* href: "/",
25-
* text: "~/myapp", // text logo (uses .logo-gradient)
26-
* darkImage: "/images/logo-light.png", // image shown in dark mode
27-
* lightImage: "/images/logo-dark.png", // image shown in light mode
28-
* imagePadding: "15px" // optional padding on img
29-
* },
30-
* badge: { text: "BETA", class: "badge-warning" },
31-
* favicon: true, // true | false | "/custom/icons/"
23+
* logo: { href: "/", text: "~/myapp" },
3224
* showAppsGrid: true,
3325
* showThemeToggle: true,
3426
* showAccount: true,
3527
* noCSS: false
3628
* };
37-
* </script>
29+
*
30+
* Then load it before shell.js:
31+
* <script src="/js/shell-config.js"></script>
3832
* <script src="https://dhanur.me/js/shell.js" defer></script>
3933
*
4034
* Script tag attributes:
@@ -51,15 +45,9 @@
5145
var MAIN_SITE = "https://dhanur.me";
5246

5347
var APPS = [
54-
{ name: "Auth", url: "https://auth.dhanur.me", icon: "fa-solid fa-key" },
48+
{ name: "Home", url: "https://dhanur.me", icon: "fa-solid fa-globe" },
49+
{ name: "Linkr", url: "https://linkr.dhanur.me", icon: "fa-solid fa-link" },
5550
{ name: "Tasks", url: "https://tasks.dhanur.me", icon: "fa-solid fa-list-check" },
56-
{ name: "Docs", url: "https://docs.dhanur.me", icon: "fa-solid fa-book" },
57-
{ name: "Code", url: "https://code.dhanur.me", icon: "fa-solid fa-code" },
58-
{ name: "Links", url: MAIN_SITE + "/links/", icon: "fa-solid fa-link" },
59-
{ name: "Blog", url: MAIN_SITE + "/blog/", icon: "fa-solid fa-pen-nib" },
60-
{ name: "Design", url: MAIN_SITE + "/design/", icon: "fa-solid fa-palette" },
61-
{ name: "About", url: MAIN_SITE + "/about/", icon: "fa-solid fa-user" },
62-
{ name: "Main", url: "https://dhanur.me", icon: "fa-solid fa-globe" },
6351
];
6452

6553
var SVG_HAMBURGER =

static/test-components.html

Lines changed: 0 additions & 49 deletions
This file was deleted.

static/test.html

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Component Test</title>
77
<!-- That's it. Just the config + script. CSS is auto-injected. -->
8-
<script>
9-
window.SiteNavConfig = {
10-
// Navigation
11-
nav: [
12-
{ name: "Home", url: "/test.html", icon: "fa-solid fa-house" },
13-
{ name: "Components", url: "/design/", icon: "fa-solid fa-palette" },
14-
{
15-
name: "Links",
16-
type: "dropdown",
17-
icon: "fa-solid fa-link",
18-
members: [
19-
{
20-
name: "GitHub",
21-
url: "https://github.com/kascit",
22-
icon: "fa-brands fa-github",
23-
},
24-
{
25-
name: "Main Site",
26-
url: "https://dhanur.me",
27-
icon: "fa-solid fa-globe",
28-
},
29-
],
30-
},
31-
],
32-
sidebarNav: [
33-
{
34-
name: "Getting Started",
35-
url: "/test.html",
36-
icon: "fa-solid fa-rocket",
37-
},
38-
{
39-
name: "Components",
40-
url: "/design/",
41-
icon: "fa-solid fa-palette",
42-
children: [
43-
{ name: "Buttons", url: "/design/#buttons" },
44-
{ name: "Cards", url: "/design/#cards" },
45-
{ name: "Forms", url: "/design/#forms" },
46-
],
47-
},
48-
{
49-
name: "API Reference",
50-
url: "/test.html#api",
51-
icon: "fa-solid fa-code",
52-
},
53-
],
54-
55-
// Chrome
56-
showSearch: false,
57-
showAppsGrid: true,
58-
showThemeToggle: true,
59-
60-
};
61-
</script>
8+
<script src="/js/shell-config.js"></script>
629
<script src="/js/shell.js" defer></script>
6310
</head>
6411
<body>

templates/macros/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
<link rel="icon" type="image/svg+xml" href="{{ favicon_svg | safe }}" />
255255
<link rel="shortcut icon" href="{{ favicon_ico | safe }}" />
256256
<link rel="apple-touch-icon" sizes="180x180" href="{{ apple_touch_icon | safe }}" />
257-
<link rel="manifest" href="https://dhanur.me/icons/site.webmanifest" />
257+
<link rel="manifest" href="/icons/site.webmanifest" />
258258

259259
<!-- CSS -->
260260
<!-- Preload critical stylesheets for faster rendering -->

templates/navbar-export.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{%- set theme_colorset = config.extra.default_colorset | default(value="dark") -%}
88
{%- endif -%}
99

10-
<div class="drawer lg:drawer-open"
10+
<div class="drawer"
1111
data-default-colorset="{{ theme_colorset }}">
1212
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" autocomplete="off" />
1313
<div class="drawer-content flex flex-col pt-16">

0 commit comments

Comments
 (0)