@@ -12,6 +12,7 @@ import { groupRoutes } from "@config/io/helpers";
1212import type { TreeEntry } from " ./Tree.astro" ;
1313import Tree from " ./Tree.astro" ;
1414import Link from " ./Link.astro" ;
15+ import VersionSelector from " ./VersionSelector.astro"
1516
1617const routes = await getTypeData ();
1718const groupedRoutes = groupRoutes (routes );
@@ -21,7 +22,7 @@ const guidePages = await getCollection("guide");
2122
2223function genGuideNav(base : string ): TreeEntry [] | undefined {
2324 const pages = guidePages
24- .filter (page => page .id .match (` ^${base }[^/]*$ ` ) !== null && page .id != " index" )
25+ .filter (page => page .id .match (` ^${base }[^/]*$ ` ) !== null && page .id !== " index" )
2526 .sort ((a , b ) => a .data .index - b .data .index )
2627 .map (page => ({
2728 title: page .data .title ,
@@ -30,7 +31,7 @@ function genGuideNav(base: string): TreeEntry[] | undefined {
3031 entries: genGuideNav (page .id + " /" ),
3132 }));
3233
33- return pages .length == 0 ? undefined : pages ;
34+ return pages .length === 0 ? undefined : pages ;
3435}
3536
3637const guide = {
@@ -58,20 +59,12 @@ const types = {
5859 ),
5960};
6061
61- const masterBranch = import .meta .env .MASTER_BRANCH ;
6262---
6363<nav class =" navtree" >
64- { masterBranch && <Link
65- title = " Docs Version: Master Branch (Switch)"
66- link =`https://quickshell.outfoxxed.me${Astro.url.pathname}`
67- />}
68- { ! masterBranch && <Link
69- title = " Docs Version: Release 0.1.0 (Switch)"
70- link =`https://quickshell-master.outfoxxed.me${Astro.url.pathname}`
71- />}
64+ <VersionSelector title =" Versions" link =`${Astro .currentLocale }` current />
7265 <Link
7366 title =" About Quickshell"
74- link =" /docs/ about"
67+ link =" /about"
7568 current ={ currentRoute === " about" }
7669 />
7770 <Tree {... guide }/>
0 commit comments