@clidey/dory 0.20.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/k8s/Dockerfile CHANGED
@@ -5,10 +5,10 @@ WORKDIR /app
5
5
  # Install git
6
6
  RUN apk add --no-cache git
7
7
 
8
- COPY ./logo/logo.svg /app/logo/logo.svg
8
+ COPY ./docs/logo/logo.svg /app/docs/logo/logo.svg
9
9
  COPY ./k8s/config/nginx-default.conf /app/k8s/config/nginx-default.conf
10
10
 
11
- RUN npm install -g @clidey/dory@0.20.0
11
+ RUN npm install -g @clidey/dory@0.21.0
12
12
  EXPOSE 3000
13
13
 
14
14
  CMD ["dory", "preview"]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clidey/dory",
3
3
  "private": false,
4
- "version": "0.20.0",
4
+ "version": "0.21.1",
5
5
  "type": "module",
6
6
  "description": "A CLI tool for building and previewing documentation sites",
7
7
  "keywords": [
@@ -7,14 +7,17 @@ import { Link } from 'wouter-preact';
7
7
  export function Navigation() {
8
8
  const pathname = usePathname();
9
9
 
10
+ const effectivePath = pathname === '/'
11
+ ? ALL_NAVIGATION[0]?.groups[0]?.pages[0]?.href ?? '/'
12
+ : pathname;
13
+
10
14
  const currentTab = useMemo(() => {
11
- // Find the tab containing the current pathname
12
15
  return ALL_NAVIGATION.find(tab =>
13
16
  tab.groups.some(group =>
14
- group.pages.some(page => page.href === pathname)
17
+ group.pages.some(page => page.href === effectivePath)
15
18
  )
16
19
  );
17
- }, [pathname]);
20
+ }, [effectivePath]);
18
21
 
19
22
  return (
20
23
  <nav className="docucod-navigation text-base lg:text-sm">
@@ -27,7 +30,7 @@ export function Navigation() {
27
30
  <h3 className="mt-4 text-sm font-semibold text-slate-900 dark:text-white">{group.title}</h3>
28
31
  <ul role="list" className="mt-2 space-y-2 border-l-2 border-slate-100 lg:mt-4 lg:space-y-4 lg:border-slate-200 dark:border-slate-800">
29
32
  {group.pages.map((page) => {
30
- const isActive = pathname === page.href;
33
+ const isActive = effectivePath === page.href;
31
34
  return (
32
35
  <li key={page.href} className="relative">
33
36
  <Link to={page.href} className={classNames(
@@ -47,10 +47,13 @@ export default function Routes() {
47
47
  useEffect(() => {
48
48
  setLoading(true);
49
49
  const loadRoutes = async () => {
50
+ // For root path, load the first navigation page
51
+ const targetPath = pathname === '/' ? ALL_NAVIGATION[0].groups[0].pages[0].href : pathname;
52
+
50
53
  const entries = await Promise.all(
51
- Object.entries(ALL_PAGES).filter(([path]) => path === pathname).map(async ([path, loader]) => {
54
+ Object.entries(ALL_PAGES).filter(([path]) => path === targetPath).map(async ([path, loader]) => {
52
55
  const module = await loader();
53
- const routePath = pathFromFilename(path);
56
+ const routePath = pathname === '/' ? '/' : pathFromFilename(path);
54
57
  return {
55
58
  path: routePath,
56
59
  component: module.default,
@@ -66,7 +69,7 @@ export default function Routes() {
66
69
 
67
70
  useEffect(() => {
68
71
  const page = ALL_NAVIGATION.find((tab) => tab.groups.find((group) => group.pages.find((page) => page.href === pathname)));
69
- if (!page) {
72
+ if (!page && pathname !== '/') {
70
73
  navigate(ALL_NAVIGATION[0].groups[0].pages[0].href);
71
74
  window.location.reload();
72
75
  }