Skip to content

Commit d24e237

Browse files
committed
update Home page
1 parent 2bebd01 commit d24e237

File tree

13 files changed

+351
-114
lines changed

13 files changed

+351
-114
lines changed

assets/index-BO6NGjxR.js

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/index-CebxbuA_.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/index-CsGTvEip.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/index-DOhwIRH1.js

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

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
gtag("js", new Date());
101101
gtag("config", "G-1B67VYZMXF");
102102
</script>
103-
<script type="module" crossorigin src="/assets/index-DOhwIRH1.js"></script>
104-
<link rel="stylesheet" crossorigin href="/assets/index-CebxbuA_.css">
103+
<script type="module" crossorigin src="/assets/index-BO6NGjxR.js"></script>
104+
<link rel="stylesheet" crossorigin href="/assets/index-CsGTvEip.css">
105105
<link rel="manifest" href="/manifest.webmanifest"></head>
106106

107107
<body>

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -eu
33

44
# minisign public key (ONLY the base64 key, without the comment line)
5-
MINISIGN_PUBKEY="RWSIfpPSznK9A1gWUc8Eg2iXXQwU5d9BYuQNKGOcoujAF2stPu5rKFjQ"
5+
MINISIGN_PUBKEY="RWTB+/RzT24X6uPqrPGKrqODmbchU4N1G00fWzQSUc+qkz7pBUnEys58"
66

77
REPO="${VIX_REPO:-vixcpp/vix}"
88
VERSION="${VIX_VERSION:-latest}" # "latest" or "v1.20.1"

sw.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vix-site/src/components/SiteHeader.vue

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!-- src/components/SiteHeader.vue -->
21
<template>
32
<header class="hdr">
43
<div class="wrap">
@@ -9,17 +8,20 @@
98
<!-- Desktop nav -->
109
<nav class="nav" aria-label="Primary">
1110
<template v-for="item in navItems" :key="itemKey(item)">
12-
<!-- Dropdown -->
11+
<!-- Dropdown: only when item has children (About) -->
1312
<div
14-
v-if="item.kind === 'dropdown'"
13+
v-if="Array.isArray(item.items) && item.items.length"
1514
class="dd"
1615
@mouseenter="openDropdown(item.label)"
1716
@mouseleave="closeDropdown(item.label)"
1817
>
1918
<button
2019
type="button"
2120
class="link dd-btn"
22-
:class="{ 'is-open': isOpen(item.label) }"
21+
:class="{
22+
'is-open': isOpen(item.label),
23+
'is-active': isActive(item) || item.items.some(isChildActive),
24+
}"
2325
@click="toggleDropdown(item.label)"
2426
aria-haspopup="menu"
2527
:aria-expanded="String(isOpen(item.label))"
@@ -29,12 +31,12 @@
2931
</button>
3032

3133
<div class="dd-menu" :class="{ open: isOpen(item.label) }" role="menu">
32-
<!-- Dropdown children: support href (docs) OR to (vue routes) -->
3334
<template v-for="child in item.items" :key="childKey(child)">
34-
<!-- External / href (same-domain docs or external) -->
35+
<!-- External child -->
3536
<a
3637
v-if="isExternal(child)"
3738
class="dd-item"
39+
:class="{ 'is-active': isChildActive(child) }"
3840
:href="child.href"
3941
:target="child.target || (isSameOrigin(child.href) ? '_self' : '_blank')"
4042
rel="noreferrer"
@@ -43,10 +45,11 @@
4345
{{ child.label }}
4446
</a>
4547

46-
<!-- Internal vue-router link -->
48+
<!-- Internal child -->
4749
<RouterLink
4850
v-else
4951
class="dd-item"
52+
:class="{ 'is-active': isChildActive(child) }"
5053
:to="child.to"
5154
@click="closeAll()"
5255
>
@@ -56,23 +59,25 @@
5659
</div>
5760
</div>
5861

59-
<!-- External top-level (GitHub etc.) -->
62+
<!-- External top-level: Docs (href) -->
6063
<a
6164
v-else-if="isExternal(item)"
6265
class="link"
66+
:class="{ 'is-active': isActive(item) }"
6367
:href="item.href"
6468
:target="item.target || (isSameOrigin(item.href) ? '_self' : '_blank')"
6569
rel="noreferrer"
70+
@click="closeAll()"
6671
>
6772
{{ item.label }}
6873
</a>
6974

70-
<!-- Internal -->
75+
<!-- Internal top-level: Install, Registry -->
7176
<RouterLink
7277
v-else
7378
class="link"
79+
:class="{ 'is-active': isActive(item) }"
7480
:to="item.to"
75-
active-class="is-active"
7681
@click="closeAll()"
7782
>
7883
{{ item.label }}
@@ -124,11 +129,12 @@
124129
</form>
125130

126131
<template v-for="item in navItems" :key="'m-' + itemKey(item)">
127-
<!-- Dropdown -->
128-
<div v-if="item.kind === 'dropdown'" class="mdd">
132+
<!-- Dropdown: only when item has children (About) -->
133+
<div v-if="Array.isArray(item.items) && item.items.length" class="mdd">
129134
<button
130135
type="button"
131136
class="mlink mdd-btn"
137+
:class="{ 'is-active': isActive(item) || item.items.some(isChildActive) }"
132138
@click="toggleMobileGroup(item.label)"
133139
:aria-expanded="String(isMobileGroupOpen(item.label))"
134140
>
@@ -138,10 +144,11 @@
138144

139145
<div v-if="isMobileGroupOpen(item.label)" class="mdd-menu">
140146
<template v-for="child in item.items" :key="'m-' + childKey(child)">
141-
<!-- External / href -->
147+
<!-- External child -->
142148
<a
143149
v-if="isExternal(child)"
144150
class="mdd-item"
151+
:class="{ 'is-active': isChildActive(child) }"
145152
:href="child.href"
146153
:target="child.target || (isSameOrigin(child.href) ? '_self' : '_blank')"
147154
rel="noreferrer"
@@ -150,10 +157,11 @@
150157
{{ child.label }}
151158
</a>
152159

153-
<!-- Internal vue-router link -->
160+
<!-- Internal child -->
154161
<RouterLink
155162
v-else
156163
class="mdd-item"
164+
:class="{ 'is-active': isChildActive(child) }"
157165
:to="child.to"
158166
@click="closeMobile()"
159167
>
@@ -163,10 +171,11 @@
163171
</div>
164172
</div>
165173

166-
<!-- External -->
174+
<!-- External top-level: Docs -->
167175
<a
168176
v-else-if="isExternal(item)"
169177
class="mlink"
178+
:class="{ 'is-active': isActive(item) }"
170179
:href="item.href"
171180
:target="item.target || (isSameOrigin(item.href) ? '_self' : '_blank')"
172181
rel="noreferrer"
@@ -175,10 +184,11 @@
175184
{{ item.label }}
176185
</a>
177186

178-
<!-- Internal -->
187+
<!-- Internal top-level -->
179188
<RouterLink
180189
v-else
181190
class="mlink"
191+
:class="{ 'is-active': isActive(item) }"
182192
:to="item.to"
183193
@click="closeMobile()"
184194
>
@@ -189,20 +199,52 @@
189199
</header>
190200
</template>
191201

202+
192203
<script setup>
193204
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
205+
import { useRoute } from "vue-router";
194206
import { NAV } from "@/data/nav";
195207
208+
const route = useRoute();
196209
const navItems = computed(() => NAV);
197210
198211
function isExternal(item) {
199212
return !!item?.external || !!item?.href;
200213
}
201214
215+
function normalizePath(p) {
216+
if (!p) return "";
217+
// keep only pathname (ignore query/hash)
218+
const q = p.indexOf("?");
219+
const h = p.indexOf("#");
220+
const cut = Math.min(q === -1 ? p.length : q, h === -1 ? p.length : h);
221+
return p.slice(0, cut);
222+
}
223+
224+
function isActive(item) {
225+
const match = item?.match || "";
226+
if (!match) return false;
227+
228+
const current = normalizePath(route.path);
229+
// exact or prefix match
230+
return current === match || current.startsWith(match + "/");
231+
}
232+
233+
function isChildActive(child) {
234+
// internal vue route
235+
if (child?.to) return normalizePath(route.path).startsWith(normalizePath(child.to));
236+
// same origin href: docs is external:true but same site, so compare path
237+
if (child?.href && isSameOrigin(child.href)) {
238+
const path = normalizePath(new URL(child.href, window.location.origin).pathname);
239+
const current = normalizePath(route.path);
240+
return current === path || current.startsWith(path + "/");
241+
}
242+
return false;
243+
}
244+
202245
// Same-origin helper: docs are same-domain (/docs/...)
203246
function isSameOrigin(href) {
204247
if (!href) return false;
205-
// relative paths like "/docs/..." are same-origin
206248
if (href.startsWith("/")) return true;
207249
try {
208250
const u = new URL(href, window.location.origin);
@@ -213,7 +255,7 @@ function isSameOrigin(href) {
213255
}
214256
215257
function itemKey(item) {
216-
if (item.kind === "dropdown") return `dd:${item.label}`;
258+
if (item.items?.length) return `dd:${item.label}`;
217259
if (isExternal(item)) return `href:${item.href}`;
218260
return `to:${item.to}`;
219261
}
@@ -274,7 +316,7 @@ onBeforeUnmount(() => {
274316
document.documentElement.classList.remove("nav-open");
275317
});
276318
277-
/* Search (docs via VitePress) */
319+
/* Search */
278320
const qDesktop = ref("");
279321
const qMobile = ref("");
280322
@@ -289,14 +331,11 @@ function submitSearch(which) {
289331
290332
closeAll();
291333
closeMobile();
292-
293-
// VitePress docs:
294-
// - simplest: go to /docs/ and let VitePress search handle it
295-
// - we also pass query param so you can read it later if you want
296334
window.location.href = `/docs/?q=${encodeURIComponent(q)}`;
297335
}
298336
</script>
299337
338+
300339
<style scoped>
301340
/* === Header shell === */
302341
.hdr{

vix-site/src/data/github_stats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"repo": "vixcpp/vix",
3-
"fetched_at": "2026-02-10T11:08:46.171Z",
3+
"fetched_at": "2026-02-10T14:31:34.153Z",
44
"stars": 267,
55
"forks": 22,
66
"open_issues": 182,

vix-site/src/data/home.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const HOME = {
66
ctas: [
77
{ label: "Get Vix.cpp", to: "/install", kind: "primary" },
88
{
9-
label: "View on GitHub",
10-
href: "https://github.com/vixcpp/vix",
9+
label: "Get started",
10+
href: "/docs/",
1111
kind: "secondary",
1212
external: true,
1313
},
@@ -104,6 +104,28 @@ i Hint: Ctrl+C to stop`,
104104
],
105105
},
106106

107+
registry: {
108+
title: "Registry built for unreliable networks",
109+
subtitle:
110+
"Sync once, search locally, and pin dependencies with vix.lock. The registry is designed for offline-first workflows.",
111+
note: "Local search works even when your connection is unstable.",
112+
ctas: [
113+
{ label: "Registry docs", to: "/registry", kind: "primary" },
114+
{
115+
label: "Try vix search",
116+
to: "/registry#search",
117+
kind: "secondary",
118+
},
119+
],
120+
preview: {
121+
title: "registry",
122+
code: `$ vix registry sync
123+
$ vix search websocket
124+
$ vix deps
125+
$ cat vix.lock`,
126+
},
127+
},
128+
107129
signals: {
108130
title: "Open-source project signals",
109131
subtitle:

0 commit comments

Comments
 (0)