diff --git a/docusaurus.config.js b/docusaurus.config.js index 89f3d0c..6d8d147 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -104,23 +104,26 @@ const config = { src: "img/logo.svg", }, items: [ - // { - // type: "docSidebar", - // sidebarId: "docSidebar", - // label: "Docs", - // position: "left", - // }, + { + type: "docSidebar", + sidebarId: "docSidebar", + label: "Docs", + position: "left", + }, // { // to: "blog/", // activeBasePath: "blog/", // label: "Blog", // position: "left", // }, + // { + // type: "localeDropdown", + // position: "right", + // }, { - href: "https://github.com/swiftwave-org/swiftwave", - label: "GitHub", - position: "right", - }, + type: 'custom-github-star-btn', + position: 'right' + } ], }, footer: { diff --git a/package.json b/package.json index 824b6e6..a9959d8 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "postcss": "^8.4.31", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", - "react-dom": "^17.0.2" + "react-dom": "^17.0.2", + "react-github-btn": "^1.4.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "2.4.1", diff --git a/src/theme/NavbarItem/ComponentTypes.js b/src/theme/NavbarItem/ComponentTypes.js new file mode 100644 index 0000000..2aa3fab --- /dev/null +++ b/src/theme/NavbarItem/ComponentTypes.js @@ -0,0 +1,7 @@ +import ComponentTypes from '@theme-original/NavbarItem/ComponentTypes'; +import GithubStarButton from './GithubStarButton'; + +export default { + ...ComponentTypes, + 'custom-github-star-btn': GithubStarButton, +}; \ No newline at end of file diff --git a/src/theme/NavbarItem/GithubStarButton.js b/src/theme/NavbarItem/GithubStarButton.js new file mode 100644 index 0000000..6d4946f --- /dev/null +++ b/src/theme/NavbarItem/GithubStarButton.js @@ -0,0 +1,8 @@ +import React from 'react'; +import GitHubButton from 'react-github-btn' + +export default function () { + return ( + Star + ); +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ac37ebe..2524aa6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4206,6 +4206,11 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +github-buttons@^2.22.0: + version "2.27.0" + resolved "https://registry.yarnpkg.com/github-buttons/-/github-buttons-2.27.0.tgz#bbebea3d1c4f8c302b7d8432fd25a679242597e2" + integrity sha512-PmfRMI2Rttg/2jDfKBeSl621sEznrsKF019SuoLdoNlO7qRUZaOyEI5Li4uW+79pVqnDtKfIEVuHTIJ5lgy64w== + github-slugger@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.5.0.tgz#17891bbc73232051474d68bd867a34625c955f7d" @@ -6384,6 +6389,13 @@ react-fast-compare@^3.2.0, react-fast-compare@^3.2.2: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49" integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ== +react-github-btn@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/react-github-btn/-/react-github-btn-1.4.0.tgz#92654107e92658e60dd977c7a92b212f806da78d" + integrity sha512-lV4FYClAfjWnBfv0iNlJUGhamDgIq6TayD0kPZED6VzHWdpcHmPfsYOZ/CFwLfPv4Zp+F4m8QKTj0oy2HjiGXg== + dependencies: + github-buttons "^2.22.0" + react-helmet-async@*: version "2.0.4" resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-2.0.4.tgz#50a4377778f380ed1d0136303916b38eff1bf153"