From 342755e904ad5c59a1937f598e0d02b6736291da Mon Sep 17 00:00:00 2001 From: akushniruk Date: Mon, 17 Feb 2025 11:36:39 +0100 Subject: [PATCH] feat: update layout, set docs config and hide navbar for the desktop --- docs/intro.md | 4 ++ docusaurus.config.js | 34 ++--------- package-lock.json | 19 ------ src/css/custom.css | 86 +++++++++++++++++++-------- src/pages/index.js | 43 -------------- src/theme/Admonition/Layout/index.js | 10 ++++ src/theme/DocSidebar/index.js | 15 +++++ static/img/erc7824.png | Bin 0 -> 3592 bytes static/img/favicon.ico | Bin 3626 -> 0 bytes static/img/logo.svg | 14 ++--- static/img/logo_dark.svg | 9 +++ 11 files changed, 110 insertions(+), 124 deletions(-) delete mode 100644 src/pages/index.js create mode 100644 src/theme/Admonition/Layout/index.js create mode 100644 src/theme/DocSidebar/index.js create mode 100644 static/img/erc7824.png delete mode 100644 static/img/favicon.ico create mode 100644 static/img/logo_dark.svg diff --git a/docs/intro.md b/docs/intro.md index d7ef8c4..9881d5c 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1,7 +1,11 @@ --- sidebar_position: 1 +slug: / +title: Introduction --- +![erc7824](/img/erc7824.png) + # Introduction ## Inject Nitro in your Stack diff --git a/docusaurus.config.js b/docusaurus.config.js index 212ccb9..832862a 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -42,27 +42,15 @@ const config = { /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { + routeBasePath: '/', sidebarPath: './sidebars.js', + breadcrumbs: false, // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: 'https://github.com/erc7824/website/tree/main/docs/', }, - blog: { - showReadingTime: true, - feedOptions: { - type: ['rss', 'atom'], - xslt: true, - }, - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', - // Useful options to enforce blogging best practices - onInlineTags: 'warn', - onInlineAuthors: 'warn', - onUntruncatedBlogPosts: 'warn', - }, + blog: false, theme: { customCss: './src/css/custom.css', }, @@ -76,25 +64,11 @@ const config = { // Replace with your project's social card image: 'img/docusaurus-social-card.jpg', navbar: { - title: 'ERC7824', logo: { alt: 'ERC-7824', src: 'img/logo.svg', + srcDark: 'img/logo_dark.svg', }, - items: [ - { - type: 'docSidebar', - sidebarId: 'tutorialSidebar', - position: 'left', - label: 'Tutorial', - }, - {to: '/blog', label: 'Blog', position: 'left'}, - { - href: 'https://github.com/erc7824/nitro', - label: 'GitHub', - position: 'right', - }, - ], }, footer: { style: 'dark', diff --git a/package-lock.json b/package-lock.json index b17484d..b69f97f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14672,12 +14672,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/search-insights": { - "version": "2.17.3", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.3.tgz", - "integrity": "sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==", - "peer": true - }, "node_modules/section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", @@ -15642,19 +15636,6 @@ "is-typedarray": "^1.0.0" } }, - "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/undici-types": { "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", diff --git a/src/css/custom.css b/src/css/custom.css index 2bc6a4c..eb62d0e 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -1,30 +1,66 @@ /** - * Any CSS included here will be global. The classic template - * bundles Infima by default. Infima is a CSS framework designed to - * work well for content-centric websites. + * Global CSS overrides for Docusaurus. + * Infima is bundled by default. */ -/* You can override the default Infima variables here. */ +/* Default theme variables */ :root { - --ifm-color-primary: #2e8555; - --ifm-color-primary-dark: #29784c; - --ifm-color-primary-darker: #277148; - --ifm-color-primary-darkest: #205d3b; - --ifm-color-primary-light: #33925d; - --ifm-color-primary-lighter: #359962; - --ifm-color-primary-lightest: #3cad6e; - --ifm-code-font-size: 95%; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); -} - -/* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); + --ifm-color-primary: #2e8555; + --ifm-color-primary-dark: #29784c; + --ifm-color-primary-darker: #277148; + --ifm-color-primary-darkest: #205d3b; + --ifm-color-primary-light: #33925d; + --ifm-color-primary-lighter: #359962; + --ifm-color-primary-lightest: #3cad6e; + --ifm-code-font-size: 95%; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); +} + +/* Dark mode variables */ +[data-theme="dark"] { + --ifm-color-primary: #25c2a0; + --ifm-color-primary-dark: #21af90; + --ifm-color-primary-darker: #1fa588; + --ifm-color-primary-darkest: #1a8870; + --ifm-color-primary-light: #29d5b0; + --ifm-color-primary-lighter: #32d8b4; + --ifm-color-primary-lightest: #4fddbf; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); +} + +[data-theme="light"] .logo [fill="#000"] { + fill: #000; +} + +[data-theme="dark"] .logo [fill="#000"] { + fill: #fff; +} + +.logo { + width: -webkit-fill-available; + height: 70px; + padding-top: 16px; + margin-top: 8px; +} + +@media (min-width: 1416px) { + html.docs-doc-page .main-wrapper { + align-self: center; + max-width: 1400px; + width: 1400px; + } +} + +.navbar .navbar__inner { + margin: 0 auto; + max-width: 1360px; +} + +@media (min-width: 996px) { + :root { + --ifm-navbar-height: 0; + } + .navbar { + display: none !important; + } } diff --git a/src/pages/index.js b/src/pages/index.js deleted file mode 100644 index a8c61f2..0000000 --- a/src/pages/index.js +++ /dev/null @@ -1,43 +0,0 @@ -import clsx from 'clsx'; -import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; -import HomepageFeatures from '@site/src/components/HomepageFeatures'; - -import Heading from '@theme/Heading'; -import styles from './index.module.css'; - -function HomepageHeader() { - const {siteConfig} = useDocusaurusContext(); - return ( -
-
- - {siteConfig.title} - -

{siteConfig.tagline}

-
- - Docusaurus Tutorial - 5min ⏱️ - -
-
-
- ); -} - -export default function Home() { - const {siteConfig} = useDocusaurusContext(); - return ( - - -
- -
-
- ); -} diff --git a/src/theme/Admonition/Layout/index.js b/src/theme/Admonition/Layout/index.js new file mode 100644 index 0000000..161683d --- /dev/null +++ b/src/theme/Admonition/Layout/index.js @@ -0,0 +1,10 @@ +import React from 'react'; +import Layout from '@theme-original/Admonition/Layout'; + +export default function LayoutWrapper(props) { + return ( + <> + + + ); +} diff --git a/src/theme/DocSidebar/index.js b/src/theme/DocSidebar/index.js new file mode 100644 index 0000000..97432e6 --- /dev/null +++ b/src/theme/DocSidebar/index.js @@ -0,0 +1,15 @@ +import React from 'react'; +import DocSidebar from '@theme-original/DocSidebar'; +import Logo from '@site/static/img/logo.svg'; + +export default function DocSidebarWrapper(props) { + + return ( + <> +
+ +
+ + + ); +} diff --git a/static/img/erc7824.png b/static/img/erc7824.png new file mode 100644 index 0000000000000000000000000000000000000000..49a38d00072c8c4363514d883f48735ad75b98fd GIT binary patch literal 3592 zcmbVMc{o&iAD?r~SjIB8Ze9slGP31Tu4Nc|2vb=ut|bZ$Mq^)+Lk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vRGw|m#Imm3dcRe#rn;@)zU)CzfX;26+mkYfIu-^ zRA7_MD_`GBiWA0uWR~&OVSlno){noK3$IXh^FACNn&M4kmP!vv(F4i zz^1{GO3doV&leS^kj!@(=IFp_WRpLBY$XWYn9i>JBp*k>h1lud6vDIxJFQEzEf2w_ zY6+6ure=a5RjJ}eJ_P>MwB??NaF)-Gwx3bp(f2GJoGd(_{HP?uQu6VDS9`4X={_eS z&~PA&<3^MrL09+WpydHf(lRH21lSV+vrsAq`RC#p5YiocRYZ1?kjM%K3Jtz;JMk`V zt@f+e_UKWME!FkUMSpr!_&Ii~qKglb33-;KY*F`$}}Oce87-3CjEr<_j7( literal 0 HcmV?d00001 diff --git a/static/img/favicon.ico b/static/img/favicon.ico deleted file mode 100644 index c01d54bcd39a5f853428f3cd5aa0f383d963c484..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3626 zcmb`Je@s(X6vrR`EK3%b%orErlDW({vnABqA zcfaS{d+xbU5JKp0*;0YOg+;Fl!eT)XRuapIwFLL`=imZCSon$`se`_<%@MB=M~KG+ z=EW^FL`w|Bo>*ktlaS^(fut!95`iG5u=SZ8nfDHO#GaTlH1-XG^;vsjUb^gWTVz0+ z^=WR1wv9-2oeR=_;fL0H7rNWqAzGtO(D;`~cX(RcN0w2v24Y8)6t`cS^_ghs`_ho? z{0ka~1Dgo8TfAP$r*ua?>$_V+kZ!-(TvEJ7O2f;Y#tezt$&R4 zLI}=-y@Z!grf*h3>}DUL{km4R>ya_I5Ag#{h_&?+HpKS!;$x3LC#CqUQ8&nM?X))Q zXAy2?`YL4FbC5CgJu(M&Q|>1st8XXLZ|5MgwgjP$m_2Vt0(J z&Gu7bOlkbGzGm2sh?X`){7w69Y$1#@P@7DF{ZE=4%T0NDS)iH`tiPSKpDNW)zmtn( zw;4$f>k)4$LBc>eBAaTZeCM2(iD+sHlj!qd z2GjRJ>f_Qes(+mnzdA^NH?^NB(^o-%Gmg$c8MNMq&`vm@9Ut;*&$xSD)PKH{wBCEC z4P9%NQ;n2s59ffMn8*5)5AAg4-93gBXBDX`A7S& zH-|%S3Wd%T79fk-e&l`{!?lve8_epXhE{d3Hn$Cg!t=-4D(t$cK~7f&4s?t7wr3ZP z*!SRQ-+tr|e1|hbc__J`k3S!rMy<0PHy&R`v#aJv?`Y?2{avK5sQz%=Us()jcNuZV z*$>auD4cEw>;t`+m>h?f?%VFJZj8D|Y1e_SjxG%J4{-AkFtT2+ZZS5UScS~%;dp!V>)7zi`w(xwSd*FS;Lml=f6hn#jq)2is4nkp+aTrV?)F6N z>DY#SU0IZ;*?Hu%tSj4edd~kYNHMFvS&5}#3-M;mBCOCZL3&;2obdG?qZ>rD|zC|Lu|sny76pn2xl|6sk~Hs{X9{8iBW zwiwgQt+@hi`FYMEhX2 - - - - - - - + + + + + + + diff --git a/static/img/logo_dark.svg b/static/img/logo_dark.svg new file mode 100644 index 0000000..f921bf8 --- /dev/null +++ b/static/img/logo_dark.svg @@ -0,0 +1,9 @@ + + + + + + + + +