diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 61c46c04f..1c32f901e 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -34,6 +34,7 @@ const config = { // Plugins we added plugins: [ + "docusaurus-plugin-sass", async function myPlugin(context, options) { return { name: "docusaurus-tailwindcss", @@ -75,7 +76,7 @@ const config = { blog: false, // Will be passed to @docusaurus/theme-classic. theme: { - customCss: require.resolve("./src/css/custom.css"), + customCss: require.resolve("./src/styles/main.scss"), }, // Will be passed to @docusaurus/plugin-content-pages (false to disable) // pages: {}, @@ -153,87 +154,13 @@ const config = { // label: "API", // to: "/api", // }, - { - href: "https://github.com/janhq/jan", - label: "GitHub", - position: "right", - }, + // { + // href: "https://github.com/janhq/jan", + // label: "GitHub", + // position: "right", + // }, ], }, - footer: { - style: "dark", - links: [ - { - title: "Jan", - items: [ - { - label: "Home", - to: "/", - }, - { - label: "Platform", - to: "/platform", - }, - { - label: "Solutions", - to: "/solutions", - }, - ], - }, - { - title: "Docs", - items: [ - { - label: "Docs", - to: "/docs", - }, - { - label: "Hardware", - to: "/hardware", - }, - { - label: "API", - to: "/api", - }, - { - label: "Changelog", - to: "/changelog", - }, - ], - }, - { - title: "Community", - items: [ - { - label: "Discord", - href: "https://discord.gg/FTk2MvZwJH", - }, - { - label: "Twitter", - href: "https://twitter.com/jan_dotai", - }, - ], - }, - { - title: "Company", - items: [ - { - label: "About", - to: "/about", - }, - { - label: "Careers", - href: "https://janai.bamboohr.com/careers", - }, - { - label: "GitHub", - href: "https://github.com/janhq/jan", - }, - ], - }, - ], - copyright: `Copyright © ${new Date().getFullYear()} Jan AI Pte Ltd.`, - }, prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, @@ -241,7 +168,7 @@ const config = { }, colorMode: { disableSwitch: false, - respectPrefersColorScheme: false, + respectPrefersColorScheme: true, }, }), }; diff --git a/docs/package.json b/docs/package.json index f69007ce2..709133d6a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -23,12 +23,15 @@ "autoprefixer": "^10.4.16", "axios": "^1.5.1", "clsx": "^1.2.1", + "docusaurus-plugin-sass": "^0.2.5", "js-yaml": "^4.1.0", "postcss": "^8.4.30", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-icons": "^4.11.0", "redocusaurus": "^1.6.3", + "sass": "^1.69.3", "tailwindcss": "^3.3.3" }, "devDependencies": { diff --git a/docs/src/components/Announcement/index.js b/docs/src/components/Announcement/index.js new file mode 100644 index 000000000..4e32a362c --- /dev/null +++ b/docs/src/components/Announcement/index.js @@ -0,0 +1,78 @@ +import React from "react"; + +import { useAppStars } from "@site/src/hooks/useAppStars"; +import { useAppRelease } from "@site/src/hooks/useAppRelease"; + +import { AiOutlineGithub, AiOutlineTwitter } from "react-icons/ai"; +import { BiLogoDiscordAlt } from "react-icons/bi"; + +const socials = [ + { + icon: , + href: "https://twitter.com/jan_dotai", + }, + { + icon: , + href: "https://discord.com/invite/FTk2MvZwJH", + }, + { + icon: , + href: "https://github.com/janhq/jan", + }, +]; + +export default function AnnoncementBanner() { + const { stargazers } = useAppStars(); + const { release } = useAppRelease(); + + return ( +
+
+ + + ✨ +
+ new +
+

+ {release.tagVersion} +  is now live on GitHub. Check it out +

+
+
+ {socials.map((social, i) => { + return ( + + {social.icon} + + ); + })} +
+
+
+ ); +} diff --git a/docs/src/components/Elements/dropdown.js b/docs/src/components/Elements/dropdown.js index 3fcb39f84..9800386e3 100644 --- a/docs/src/components/Elements/dropdown.js +++ b/docs/src/components/Elements/dropdown.js @@ -57,21 +57,24 @@ export default function Dropdown() { const updateDownloadLinks = async () => { try { const releaseInfo = await getLatestReleaseInfo("janhq", "jan"); - + // Extract appname from the first asset name const firstAssetName = releaseInfo.assets[0].name; const appname = extractAppName(firstAssetName); - + if (!appname) { - console.error("Failed to extract appname from file name:", firstAssetName); + console.error( + "Failed to extract appname from file name:", + firstAssetName + ); return; } - + // Remove 'v' at the start of the tag_name const tag = releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name; - + const updatedSystems = systems.map((system) => { const downloadUrl = system.fileFormat .replace("{appname}", appname) @@ -81,21 +84,21 @@ export default function Dropdown() { href: `https://github.com/janhq/jan/releases/download/${releaseInfo.tag_name}/${downloadUrl}`, }; }); - + setSystems(updatedSystems); setDefaultSystem(updatedSystems[0]); } catch (error) { console.error("Failed to update download links:", error); } }; - + updateDownloadLinks(); }, []); return (
- + Open OS options - - -
+ +
{systems.map((system) => ( {({ active }) => ( Logo - {system.name} + {system.name} )} diff --git a/docs/src/components/Footer/index.js b/docs/src/components/Footer/index.js new file mode 100644 index 000000000..f52dd919d --- /dev/null +++ b/docs/src/components/Footer/index.js @@ -0,0 +1,123 @@ +import React from "react"; + +const menus = [ + { + name: "Resources", + child: [ + { + menu: "Home", + path: "/", + }, + { + menu: "Platform", + path: "/platform", + }, + { + menu: "Solutions", + path: "/solutions", + }, + ], + }, + { + name: "For Developers", + child: [ + { + menu: "Documentations", + path: "/docs", + }, + { + menu: "Hardware", + path: "/hardware", + }, + { + menu: "API", + path: "/api", + }, + { + menu: "Changelog", + path: "/changelog", + }, + ], + }, + { + name: "Community", + child: [ + { + menu: "Github", + path: "https://github.com/janhq/jan", + external: true, + }, + { + menu: "Discord", + path: "https://discord.gg/FTk2MvZwJH", + external: true, + }, + { + menu: "Twitter", + path: "https://twitter.com/jan_dotai", + external: true, + }, + ], + }, + { + name: "Company", + child: [ + { + menu: "About", + path: "/about", + }, + { + menu: "Careers", + path: "https://janai.bamboohr.com/careers", + external: true, + }, + ], + }, +]; + +const getCurrentYear = new Date().getFullYear(); + +export default function Footer() { + return ( +
+
+
+
+
Jan
+

+ is a source-available, cross device, and privacy focused AI engine + and Desktop app that runs locally on your machine. +

+
+ {menus.map((menu, i) => { + return ( +
+
{menu.name}
+ +
+ ); + })} +
+
+
+ + ©{getCurrentYear} Jan AI Pte Ltd. + +
+
+ ); +} diff --git a/docs/src/components/Homepage/banner.js b/docs/src/components/Homepage/banner.js deleted file mode 100644 index 24520e747..000000000 --- a/docs/src/components/Homepage/banner.js +++ /dev/null @@ -1,32 +0,0 @@ -import React from "react"; -import { XMarkIcon } from "@heroicons/react/20/solid"; -import { useColorMode } from "@docusaurus/theme-common"; - -export default function HomepageBanner() { - const { colorMode } = useColorMode(); - const bannerText = - "🚧 This site is under construction - expect breaking changes! 🚧"; - return colorMode === "dark" ? ( -
- {bannerText} -
- ) : ( -
- - ); -} diff --git a/docs/src/components/Homepage/downloads.js b/docs/src/components/Homepage/downloads.js deleted file mode 100644 index f14ebf8f6..000000000 --- a/docs/src/components/Homepage/downloads.js +++ /dev/null @@ -1,77 +0,0 @@ -import React from "react"; -import { - ArrowPathIcon, - CloudArrowUpIcon, - LockClosedIcon, -} from "@heroicons/react/20/solid"; - -const systems = [ - { - name: "Mac", - description: - "Commodo nec sagittis tortor mauris sed. Turpis tortor quis scelerisque diam id accumsan nullam tempus. Pulvinar etiam lacus volutpat eu. Phasellus praesent ligula sit faucibus.", - href: "#", - icon: CloudArrowUpIcon, - }, - { - name: "Windows", - description: - "Pellentesque enim a commodo malesuada turpis eleifend risus. Facilisis donec placerat sapien consequat tempor fermentum nibh.", - href: "#", - icon: LockClosedIcon, - }, - { - name: "Linux", - description: - "Pellentesque sit elit congue ante nec amet. Dolor aenean curabitur viverra suspendisse iaculis eget. Nec mollis placerat ultricies euismod ut condimentum.", - href: "#", - icon: ArrowPathIcon, - }, -]; - -export default function HomepageDownloads() { - return ( -
-
-
-

- Run AI on any OS -

-

- Downloads -

-

- Jan is compatible with all major operating systems. Download the - latest stable versions here. -

-
-
-
- {systems.map((system) => ( -
-
-
-
-

{system.description}

-

- - Learn more - -

-
-
- ))} -
-
-
-
- ); -} diff --git a/docs/src/components/Homepage/hero.js b/docs/src/components/Homepage/hero.js deleted file mode 100644 index da3fa8e93..000000000 --- a/docs/src/components/Homepage/hero.js +++ /dev/null @@ -1,102 +0,0 @@ -import React from "react"; -import { ArrowTopRightOnSquareIcon } from "@heroicons/react/20/solid"; -import { useColorMode } from "@docusaurus/theme-common"; -import Dropdown from "@site/src/components/Elements/dropdown"; - -export default function HomepageHero() { - const { colorMode } = useColorMode(); - - return ( -
-
- {/* Background top gradient styling */} - {colorMode === "dark" ? ( -