+
+
The JavaScript framework for data portals
@@ -56,7 +54,15 @@ export function Hero() {
Get started
-
+
+ View on GitHub
+
+
+
@@ -75,84 +81,13 @@ export function Hero() {
- {/*
+
-
-
-
- {tabs.map((tab) => (
-
- ))}
-
-
-
- {Array.from({
- length: code.split('\n').length,
- }).map((_, index) => (
-
- {(index + 1).toString().padStart(2, '0')}
-
-
- ))}
-
-
- {({
- className,
- style,
- tokens,
- getLineProps,
- getTokenProps,
- }) => (
-
-
- {tokens.map((line, lineIndex) => (
-
- {line.map((token, tokenIndex) => (
-
- ))}
-
- ))}
-
-
- )}
-
-
-
+
-
*/}
+
diff --git a/site/components/Layout.tsx b/site/components/Layout.tsx
index 002c59f9..4c15e75a 100644
--- a/site/components/Layout.tsx
+++ b/site/components/Layout.tsx
@@ -5,7 +5,8 @@ import Link from 'next/link';
import { useCallback, useEffect, useState } from 'react';
import Nav from './Nav';
-import { SiteToc } from '@/components/SiteToc';
+import { Hero } from './Hero';
+import { Navigation } from './Navigation';
function useTableOfContents(tableOfContents) {
const [currentSection, setCurrentSection] = useState(tableOfContents[0]?.id);
@@ -54,14 +55,15 @@ export default function Layout({
children,
title,
tableOfContents = [],
- urlPath,
- sidebarTree = []
+ isHomePage = false,
+ sidebarTree = [],
}: {
children;
title?: string;
tableOfContents?;
urlPath?: string;
sidebarTree?: [];
+ isHomePage?: boolean;
}) {
// const { toc } = children.props;
const { theme, setTheme } = useTheme();
@@ -83,7 +85,72 @@ export default function Layout({
{title &&
}
- {children}
+ {isHomePage &&
}
+
+
+ {!!sidebarTree.length && (
+
+ )}
+
+ {children}
+
+ {/** TABLE OF CONTENTS */}
+
+ {tableOfContents.length > 0 && siteConfig.tableOfContents && (
+
+
+ On this page
+
+
+ {tableOfContents.map((section) => (
+
+
+
+ {section.title}
+
+
+ {section.children && section.children.length > 0 && (
+
+ {section.children.map((subSection) => (
+
+
+ {subSection.title}
+
+
+ ))}
+
+ )}
+
+ ))}
+
+
+ )}
+
+
- {/** TABLE OF CONTENTS */}
- {tableOfContents.length > 0 && siteConfig.tableOfContents && (
-
-
-
- On this page
-
-
- {tableOfContents.map((section) => (
-
-
-
- {section.title}
-
-
- {section.children && section.children.length > 0 && (
-
- {section.children.map((subSection) => (
-
-
- {subSection.title}
-
-
- ))}
-
- )}
-
- ))}
-
-
-
- )}
- {/* LHS NAVIGATION */}
- {/* {showSidebar && ( */}
-
-
-
- {/* )} */}
>
);
}
diff --git a/site/components/Nav.tsx b/site/components/Nav.tsx
index 18ee469a..296f6fda 100644
--- a/site/components/Nav.tsx
+++ b/site/components/Nav.tsx
@@ -5,6 +5,7 @@ import { siteConfig } from '../config/siteConfig';
import MobileNavigation from './MobileNavigation';
import NavItem from './NavItem';
import ThemeSelector from './ThemeSelector';
+import GitHubButton from 'react-next-github-btn';
// import { SearchContext, SearchField } from "./search/index.jsx";
// const Search = SearchContext(siteConfig.search?.provider);
@@ -110,16 +111,6 @@ export default function Nav() {
)} */}
- {siteConfig.github && (
-
-
-
- )}
{siteConfig.discord && (
)}
+ {siteConfig.github && (
+
+ <
+ // @ts-ignore
+ GitHubButton
+ href={siteConfig.github}
+ data-color-scheme="no-preference: light; light: light; dark: dark;"
+ data-size="large"
+ data-show-count="true"
+ aria-label="Star PortalJS on GitHub"
+ >
+ Stars
+
+
+ )}
);
diff --git a/site/components/NavItem.tsx b/site/components/NavItem.tsx
index 1fc597e2..97ab98ab 100644
--- a/site/components/NavItem.tsx
+++ b/site/components/NavItem.tsx
@@ -1,8 +1,8 @@
-import { Menu, Transition } from "@headlessui/react";
-import Link from "next/link";
-import { Fragment, useRef, useState } from "react";
+import { Menu, Transition } from '@headlessui/react';
+import Link from 'next/link';
+import { Fragment, useRef, useState } from 'react';
-import BaseLink from "./BaseLink";
+import BaseLink from './BaseLink';
export default function NavItem({ item }) {
const dropdownRef = useRef(null);
@@ -21,14 +21,14 @@ export default function NavItem({ item }) {
return (