From b01da70aa0785c561065290a432e025846da7a2d Mon Sep 17 00:00:00 2001
From: Damian Stasik <920747+damianstasik@users.noreply.github.com>
Date: Thu, 7 Sep 2023 13:10:44 +0200
Subject: [PATCH] Change of plans, focus only on navbar
---
docusaurus.config.js | 31 +++++++++-----------
src/css/custom.css | 25 ++++++++++++++--
src/theme/BlogPostPage/Metadata/index.js | 29 -------------------
src/theme/BlogPostPage/index.js | 25 ----------------
src/theme/BlogPostPaginator/index.tsx | 6 ----
src/theme/DocItem/index.tsx | 6 ----
src/theme/DocPage/index.tsx | 6 ----
src/theme/ErrorPageContent.tsx | 20 -------------
src/theme/Layout/Provider/index.tsx | 24 ---------------
src/theme/Layout/index.tsx | 37 ------------------------
src/theme/Navbar/Content/index.tsx | 2 +-
src/theme/SearchBar.tsx | 1 -
src/theme/SearchMetadata/index.tsx | 32 --------------------
src/theme/SkipToContent/index.tsx | 8 -----
14 files changed, 38 insertions(+), 214 deletions(-)
delete mode 100644 src/theme/BlogPostPage/Metadata/index.js
delete mode 100644 src/theme/BlogPostPage/index.js
delete mode 100644 src/theme/BlogPostPaginator/index.tsx
delete mode 100644 src/theme/DocItem/index.tsx
delete mode 100644 src/theme/DocPage/index.tsx
delete mode 100644 src/theme/ErrorPageContent.tsx
delete mode 100644 src/theme/Layout/Provider/index.tsx
delete mode 100644 src/theme/Layout/index.tsx
delete mode 100644 src/theme/SearchBar.tsx
delete mode 100644 src/theme/SearchMetadata/index.tsx
delete mode 100644 src/theme/SkipToContent/index.tsx
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 07a089fd..9f883100 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -24,28 +24,25 @@ const config = {
locales: ["en"],
},
- themes: [
- function customTheme() {
- return {
- name: "custom-theme",
- getClientModules() {
- return [require.resolve("./src/css/custom.css")];
+ presets: [
+ [
+ "classic",
+ /** @type {import('@docusaurus/preset-classic').Options} */
+ ({
+ theme: {
+ customCss: [require.resolve("./src/css/custom.css")],
},
- };
- },
+ docs: {
+ sidebarPath: require.resolve("./sidebars.js"),
+ routeBasePath: "/docs",
+ },
+ blog: false,
+ }),
+ ],
],
plugins: [
"./plugins/blog-plugin",
- [
- "@docusaurus/plugin-content-docs",
- {
- sidebarPath: require.resolve("./sidebars.js"),
- routeBasePath: "/docs",
- },
- ],
- // "@docusaurus/plugin-content-blog",
- "@docusaurus/plugin-content-pages",
function tailwindPlugin() {
return {
name: "tailwindcss",
diff --git a/src/css/custom.css b/src/css/custom.css
index d9f083d2..495bf88b 100644
--- a/src/css/custom.css
+++ b/src/css/custom.css
@@ -4,8 +4,29 @@
@tailwind components;
@tailwind utilities;
-html {
- background-color: theme("colors.dark1");
+html[data-theme="dark"] {
+ --ifm-color-primary: #b173ff;
+ --ifm-color-primary-dark: #9c4eff;
+ --ifm-color-primary-darker: #923cff;
+ --ifm-color-primary-darkest: #7304ff;
+ --ifm-color-primary-light: #c698ff;
+ --ifm-color-primary-lighter: #d0aaff;
+ --ifm-color-primary-lightest: #efe2ff;
+ --ifm-background-color: theme("colors.dark1");
+ --ifm-navbar-background-color: transparent;
+ --ifm-heading-font-family: theme("fontFamily.sans");
+ --ifm-navbar-item-padding-horizontal: 0;
+ --ifm-navbar-height: theme("height.24");
+ --ifm-toc-border-color: transparent;
+}
+
+.theme-doc-sidebar-menu {
+ border-right: 1px solid rgba(255, 255, 255, 0.1);
+ padding-right: 20px;
+}
+
+.table-of-contents {
+ border-left: 1px solid rgba(255, 255, 255, 0.1);
}
body {
diff --git a/src/theme/BlogPostPage/Metadata/index.js b/src/theme/BlogPostPage/Metadata/index.js
deleted file mode 100644
index e8be4390..00000000
--- a/src/theme/BlogPostPage/Metadata/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from "react";
-import { PageMetadata } from "@docusaurus/theme-common";
-import { useBlogPost } from "@docusaurus/theme-common/internal";
-
-export default function BlogPostPageMetadata() {
- const { assets, metadata } = useBlogPost();
- const { title, description, date, tags, frontMatter } = metadata;
- const { keywords } = frontMatter;
- const image = assets.image ?? frontMatter.image;
-
- return (
-
-
-
-
- {tags.length > 0 && (
- tag.label).join(",")}
- />
- )}
-
- );
-}
diff --git a/src/theme/BlogPostPage/index.js b/src/theme/BlogPostPage/index.js
deleted file mode 100644
index 459b49be..00000000
--- a/src/theme/BlogPostPage/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from "react";
-import { BlogPostProvider } from "@docusaurus/theme-common/internal";
-import BlogLayout from "@theme/BlogLayout";
-import BlogPostItem from "@theme/BlogPostItem";
-
-import BlogPostPageMetadata from "@theme/BlogPostPage/Metadata";
-
-function BlogPostPageContent({ children }) {
- return (
-
- {children}
-
- );
-}
-export default function BlogPostPage(props) {
- const BlogPostContent = props.content;
- return (
-
-
-
-
-
-
- );
-}
diff --git a/src/theme/BlogPostPaginator/index.tsx b/src/theme/BlogPostPaginator/index.tsx
deleted file mode 100644
index a148cfa8..00000000
--- a/src/theme/BlogPostPaginator/index.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from "react";
-
-// TODO
-export default function BlogPostPaginator() {
- return <>>;
-}
diff --git a/src/theme/DocItem/index.tsx b/src/theme/DocItem/index.tsx
deleted file mode 100644
index 7b6f3a57..00000000
--- a/src/theme/DocItem/index.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from "react";
-
-// TODO
-export default function DotItem() {
- return <>>;
-}
diff --git a/src/theme/DocPage/index.tsx b/src/theme/DocPage/index.tsx
deleted file mode 100644
index 4a660b2b..00000000
--- a/src/theme/DocPage/index.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from "react";
-
-// TODO
-export default function DocPage() {
- return <>>;
-}
diff --git a/src/theme/ErrorPageContent.tsx b/src/theme/ErrorPageContent.tsx
deleted file mode 100644
index 3ecdc3da..00000000
--- a/src/theme/ErrorPageContent.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from "react";
-import {
- ErrorBoundaryError,
- ErrorBoundaryTryAgainButton,
-} from "@docusaurus/theme-common";
-import type { Props } from "@theme/Error";
-
-export default function ErrorPageContent({ error, tryAgain }: Props) {
- return (
-
- This page crashed.
-
-
-
-
-
-
-
- );
-}
diff --git a/src/theme/Layout/Provider/index.tsx b/src/theme/Layout/Provider/index.tsx
deleted file mode 100644
index 058e4c02..00000000
--- a/src/theme/Layout/Provider/index.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import React from "react";
-import { composeProviders } from "@docusaurus/theme-common";
-import {
- ColorModeProvider,
- AnnouncementBarProvider,
- DocsPreferredVersionContextProvider,
- ScrollControllerProvider,
- NavbarProvider,
- PluginHtmlClassNameProvider,
-} from "@docusaurus/theme-common/internal";
-import type { Props } from "@theme/Layout/Provider";
-
-const Provider = composeProviders([
- ColorModeProvider,
- AnnouncementBarProvider,
- ScrollControllerProvider,
- DocsPreferredVersionContextProvider,
- PluginHtmlClassNameProvider,
- NavbarProvider,
-]);
-
-export default function LayoutProvider({ children }: Props) {
- return {children};
-}
diff --git a/src/theme/Layout/index.tsx b/src/theme/Layout/index.tsx
deleted file mode 100644
index f669c609..00000000
--- a/src/theme/Layout/index.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from "react";
-import ErrorBoundary from "@docusaurus/ErrorBoundary";
-import {
- PageMetadata,
- SkipToContentFallbackId,
-} from "@docusaurus/theme-common";
-import { useKeyboardNavigation } from "@docusaurus/theme-common/internal";
-import SkipToContent from "@theme/SkipToContent";
-import Navbar from "@theme/Navbar";
-import Footer from "@theme/Footer";
-import LayoutProvider from "@theme/Layout/Provider";
-import ErrorPageContent from "@theme/ErrorPageContent";
-import type { Props } from "@theme/Layout";
-
-export default function Layout(props: Props) {
- const { children, noFooter, wrapperClassName, title, description } = props;
-
- useKeyboardNavigation();
-
- return (
-
-
-
-
-
-
-
-
- }>
- {children}
-
-
-
- {!noFooter && }
-
- );
-}
diff --git a/src/theme/Navbar/Content/index.tsx b/src/theme/Navbar/Content/index.tsx
index c76df623..6dbc834b 100644
--- a/src/theme/Navbar/Content/index.tsx
+++ b/src/theme/Navbar/Content/index.tsx
@@ -32,7 +32,7 @@ export default function NavbarContent() {
const searchBarItem = items.find((item) => item.type === "search");
return (
-
+
diff --git a/src/theme/SearchBar.tsx b/src/theme/SearchBar.tsx
deleted file mode 100644
index d1ad6ac9..00000000
--- a/src/theme/SearchBar.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@docusaurus/Noop";
diff --git a/src/theme/SearchMetadata/index.tsx b/src/theme/SearchMetadata/index.tsx
deleted file mode 100644
index 8c32b5ed..00000000
--- a/src/theme/SearchMetadata/index.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React from "react";
-
-import Head from "@docusaurus/Head";
-import type { Props } from "@theme/SearchMetadata";
-
-// Note: we bias toward using Algolia metadata on purpose
-// Not doing so leads to confusion in the community,
-// as it requires to first crawl the site with the Algolia plugin enabled first
-// - https://github.com/facebook/docusaurus/issues/6693
-// - https://github.com/facebook/docusaurus/issues/4555
-export default function SearchMetadata({ locale, version, tag }: Props) {
- // Seems safe to consider here the locale is the language, as the existing
- // docsearch:language filter is afaik a regular string-based filter
- const language = locale;
-
- return (
-
- {/*
- Docusaurus metadata, used by third-party search plugin
- See https://github.com/cmfcmf/docusaurus-search-local/issues/99
- */}
- {locale && }
- {version && }
- {tag && }
-
- {/* Algolia DocSearch metadata */}
- {language && }
- {version && }
- {tag && }
-
- );
-}
diff --git a/src/theme/SkipToContent/index.tsx b/src/theme/SkipToContent/index.tsx
deleted file mode 100644
index f57ef528..00000000
--- a/src/theme/SkipToContent/index.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from "react";
-import { SkipToContentLink } from "@docusaurus/theme-common";
-
-export default function SkipToContent() {
- return (
-
- );
-}