diff --git a/docs/fundamentals/command-line-options.md b/docs/fundamentals/command-line-options.md index c77bfd0fab..a110ddeee5 100644 --- a/docs/fundamentals/command-line-options.md +++ b/docs/fundamentals/command-line-options.md @@ -3,8 +3,7 @@ title: Command-line Options description: A list of commands for Geth --- -Geth is primarily controlled using the command line. Geth is started using the `geth` command. Geth is stopped by pressing `ctrl-c`. There are then many combinations of commands that configure precisely how geth will run. These commands are displayed below. The same information can be -obtained at any time from your Geth instance by running: +Geth is primarily controlled using the command line. Geth is started using the `geth` command. Geth is stopped by pressing `ctrl-c`. There are then many combinations of commands that configure precisely how geth will run. These commands are displayed below. The same information can be obtained at any time from your Geth instance by running: ```sh geth --help diff --git a/src/components/UI/docs/Breadcrumbs.tsx b/src/components/UI/docs/Breadcrumbs.tsx index e1b6f71304..c451bb78fd 100644 --- a/src/components/UI/docs/Breadcrumbs.tsx +++ b/src/components/UI/docs/Breadcrumbs.tsx @@ -6,7 +6,7 @@ import { FC } from 'react'; export const Breadcrumbs: FC = () => { const router = useRouter(); - let pathSplit = router.asPath.split('/'); + let pathSplit = router.asPath.split('#')[0].split('/'); pathSplit = pathSplit.splice(1, pathSplit.length); return ( diff --git a/src/components/UI/docs/DocsLinks.tsx b/src/components/UI/docs/DocsLinks.tsx index 14beb534ed..ab77e803ae 100644 --- a/src/components/UI/docs/DocsLinks.tsx +++ b/src/components/UI/docs/DocsLinks.tsx @@ -9,8 +9,9 @@ import { Stack, Text } from '@chakra-ui/react'; -import { AddIcon, MinusIcon } from '@chakra-ui/icons'; +import { AddIcon, MinusIcon } from '../svgs/' import NextLink from 'next/link'; +import { useRouter } from 'next/router'; import { LinksList } from './'; @@ -20,62 +21,83 @@ interface Props { navLinks: NavLink[]; } -export const DocsLinks: FC = ({ navLinks }) => ( - - {navLinks.map(({ id, to, items }, idx) => { - return ( - - - {({ isExpanded }) => ( - <> - - = ({ navLinks }) => { + const router = useRouter(); + const { slug } = router.query; + return ( + + {navLinks.map(({ id, to, items }, idx) => { + const split = to?.split('/') + const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1]; + return ( + + + {({ isExpanded }) => ( + <> + - {to ? ( - - - {id} - - - ) : ( - {id} - )} - - - {items && ( - -
- {isExpanded ? ( - - ) : ( - - )} -
+ + {to ? ( + + + + {id} + + + + ) : ( + {id} + )} + + {items && ( + +
+ {isExpanded ? ( + + ) : ( + + )} +
+
+ )} +
+ {items && ( + + + )} - - {items && ( - - - - )} - - )} -
-
- ); - })} -
-); + + )} + + + ); + })} + + ); +} diff --git a/src/components/UI/docs/DocumentNav.tsx b/src/components/UI/docs/DocumentNav.tsx index 07adf63ad3..e5d0c39877 100644 --- a/src/components/UI/docs/DocumentNav.tsx +++ b/src/components/UI/docs/DocumentNav.tsx @@ -28,11 +28,28 @@ export const DocumentNav: FC = ({ content }) => { {parsedHeadings.map((heading, idx) => { return ( - + {heading?.title} diff --git a/src/components/UI/docs/LinkList.tsx b/src/components/UI/docs/LinkList.tsx deleted file mode 100644 index d8c84c72d5..0000000000 --- a/src/components/UI/docs/LinkList.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { FC } from 'react'; -import { Link, Stack, Text } from '@chakra-ui/react'; -import NextLink from 'next/link'; - -import { NavLink } from '../../../types'; - -interface LinksListProps { - links: NavLink[]; -} - -export const LinksList: FC = ({ links }) => ( - - {links.map(({ id, to, items }) => { - return to ? ( - - - - - {id} - - - - {items && } - - ) : ( - - - {id} - - {items && } - - ); - })} - -); diff --git a/src/components/UI/docs/LinksList.tsx b/src/components/UI/docs/LinksList.tsx new file mode 100644 index 0000000000..6c9d838e1d --- /dev/null +++ b/src/components/UI/docs/LinksList.tsx @@ -0,0 +1,57 @@ +import { FC } from 'react'; +import { Link, Stack, Text } from '@chakra-ui/react'; +import NextLink from 'next/link'; +import { useRouter } from 'next/router'; + +import { NavLink } from '../../../types'; + +interface LinksListProps { + links: NavLink[]; +} + +export const LinksList: FC = ({ links }) => { + const router = useRouter(); + const { slug } = router.query; + return ( + + {links.map(({ id, to, items }) => { + const split = to?.split('/') + const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1]; + return to ? ( + + + + + {id} + + + + {items && } + + ) : ( + + + {id} + + {items && } + + ); + })} + + ); +}; diff --git a/src/components/UI/docs/MDComponents.tsx b/src/components/UI/docs/MDComponents.tsx index 09f8b2b71f..dab3a440d1 100644 --- a/src/components/UI/docs/MDComponents.tsx +++ b/src/components/UI/docs/MDComponents.tsx @@ -101,7 +101,7 @@ const MDComponents = { }, // tables table: ({ children }: any) => ( - + { - return {children}; + return {children}; }, note: ({ children }: any) => { return {children}; diff --git a/src/components/UI/docs/index.ts b/src/components/UI/docs/index.ts index 9214774f4c..56eadcff2b 100644 --- a/src/components/UI/docs/index.ts +++ b/src/components/UI/docs/index.ts @@ -3,6 +3,6 @@ export * from './Code'; export * from './DocsLinks'; export * from './DocsNav'; export * from './DocumentNav'; -export * from './LinkList'; +export * from './LinksList'; export * from './Note'; export { default } from './MDComponents'; diff --git a/src/components/UI/downloads/DownloadsTable.tsx b/src/components/UI/downloads/DownloadsTable.tsx index d77789f73f..7b3263313c 100644 --- a/src/components/UI/downloads/DownloadsTable.tsx +++ b/src/components/UI/downloads/DownloadsTable.tsx @@ -33,6 +33,8 @@ export const DownloadsTable: FC = ({ androidData.length ]; + const LAST_2_LINUX_RELEASES = amountOfReleasesToShow + 12; + return ( setTotalReleases(totalReleases[idx])}> @@ -61,7 +63,7 @@ export const DownloadsTable: FC = ({ diff --git a/src/components/UI/svgs/AddIcon.tsx b/src/components/UI/svgs/AddIcon.tsx new file mode 100644 index 0000000000..fe8f3016c9 --- /dev/null +++ b/src/components/UI/svgs/AddIcon.tsx @@ -0,0 +1,21 @@ +import { IconProps } from '@chakra-ui/react'; +import { createIcon } from '@chakra-ui/icons'; + +const [w, h] = [24, 24]; + +const Icon = createIcon({ + displayName: 'AddIcon', + viewBox: `0 0 ${w} ${h}`, + path: ( + + + + + + + ) +}); + +export const AddIcon: React.FC = props => ( + +); diff --git a/src/components/UI/svgs/MinusIcon.tsx b/src/components/UI/svgs/MinusIcon.tsx new file mode 100644 index 0000000000..689f611370 --- /dev/null +++ b/src/components/UI/svgs/MinusIcon.tsx @@ -0,0 +1,20 @@ +import { IconProps } from '@chakra-ui/react'; +import { createIcon } from '@chakra-ui/icons'; + +const [w, h] = [24, 24]; + +const Icon = createIcon({ + displayName: 'MinusIcon', + viewBox: `0 0 ${w} ${h}`, + path: ( + + + + + + ) +}); + +export const MinusIcon: React.FC = props => ( + +); diff --git a/src/components/UI/svgs/index.ts b/src/components/UI/svgs/index.ts index c1a85f7e2c..91312334c8 100644 --- a/src/components/UI/svgs/index.ts +++ b/src/components/UI/svgs/index.ts @@ -1,5 +1,7 @@ +export * from './AddIcon'; export * from './GlyphHome'; export * from './GopherDownloads'; export * from './GopherHomeFront'; export * from './GopherHomeLinks'; export * from './GopherHomeNodes'; +export * from './MinusIcon'; diff --git a/src/components/layouts/Footer.tsx b/src/components/layouts/Footer.tsx index 14db5fddfe..cd9802ca11 100644 --- a/src/components/layouts/Footer.tsx +++ b/src/components/layouts/Footer.tsx @@ -12,6 +12,12 @@ import { import { DiscordIcon, GitHubIcon, TwitterIcon } from '../UI/icons'; +const hoverStyles = { + textDecoration: 'none', + bg: 'primary', + color: 'bg !important' +}; + export const Footer: FC = () => { return ( @@ -32,11 +38,7 @@ export const Footer: FC = () => {
{
{ lg: 'none' }} borderColor='primary !important' - _hover={{ - bg: 'primary' - }} + _hover={hoverStyles} p={4} > @@ -96,9 +92,7 @@ export const Footer: FC = () => {
{
diff --git a/src/constants.ts b/src/constants.ts index 3e282e0b85..58c0354042 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -20,7 +20,7 @@ export const GETH_DISCORD_URL = 'https://discord.com/invite/nthXNEv'; export const GO_URL = 'https://go.dev/'; // Downloads -export const DEFAULT_BUILD_AMOUNT_TO_SHOW = 10; +export const DEFAULT_BUILD_AMOUNT_TO_SHOW = 12; export const DOWNLOAD_HEADER_BUTTONS: { [index: string]: { name: string; diff --git a/src/data/documentation-links.yaml b/src/data/documentation-links.yaml index 137b4574d2..f889d4cc6f 100644 --- a/src/data/documentation-links.yaml +++ b/src/data/documentation-links.yaml @@ -1,6 +1,7 @@ - id: Getting started - to: /docs/getting-started items: + - id: Introduction + to: /docs/getting-started - id: Hardware requirements to: /docs/getting-started/hardware-requirements - id: Installing Geth @@ -8,8 +9,9 @@ - id: Consensus clients to: /docs/getting-started/consensus-clients - id: Fundamentals - to: /docs/fundamentals items: + - id: Introduction + to: /docs/fundamentals - id: Node architecture to: /docs/fundamentals/node-architecture - id: Command-line options @@ -35,8 +37,9 @@ - id: Interacting with Geth items: - id: JSON-RPC Server - to: /docs/interacting-with-geth/rpc items: + - id: Introduction + to: /docs/interacting-with-geth/rpc - id: Batch requests to: /docs/interacting-with-geth/rpc/batch - id: GraphQL server @@ -70,8 +73,9 @@ - id: 'JavaScript Console 2: Contracts' to: /docs/interacting-with-geth/javascript-console-contracts - id: Developers - to: /docs/developers items: + - id: Introduction + to: /docs/developers - id: Dapp developers items: - id: Go API @@ -83,8 +87,9 @@ - id: Geth for Mobile to: /docs/developers/dapp-developer/mobile - id: EVM tracing - to: /docs/developers/evm-tracing items: + - id: Introduction + to: /docs/developers/evm-tracing - id: Basic traces to: /docs/developers/evm-tracing/basic-traces - id: Built-in tracers diff --git a/src/pages/[...slug].tsx b/src/pages/[...slug].tsx index 9119adae5a..1d24e72165 100644 --- a/src/pages/[...slug].tsx +++ b/src/pages/[...slug].tsx @@ -63,7 +63,7 @@ export const getStaticProps: GetStaticProps = async context => { content, navLinks, lastModified: getParsedDate(lastModified.mtime, { - month: 'numeric', + month: 'long', day: 'numeric', year: 'numeric' }) @@ -111,12 +111,12 @@ const DocPage: NextPage = ({ frontmatter, content, navLinks, lastModified {frontmatter.title} - last edited {lastModified} + Last edited on {lastModified} - - + + = ({ frontmatter, content, navLinks, lastModified - + diff --git a/src/pages/downloads.tsx b/src/pages/downloads.tsx index 7be72330b9..06f546df22 100644 --- a/src/pages/downloads.tsx +++ b/src/pages/downloads.tsx @@ -287,11 +287,11 @@ const DownloadsPage: NextPage = ({ data }) => { const [totalDevBuilds, setTotalDevBuilds] = useState(ALL_LINUX_DEV_BUILDS.length); const showMoreStableReleases = () => { - setAmountStableReleases(amountStableReleases + 10); + setAmountStableReleases(amountStableReleases + 12); }; const showMoreDevBuilds = () => { - setAmountDevBuilds(amountDevBuilds + 10); + setAmountDevBuilds(amountDevBuilds + 12); }; return ( @@ -374,25 +374,14 @@ const DownloadsPage: NextPage = ({ data }) => { - - - {totalStableReleases > 0 - ? `Showing ${Math.min( - amountStableReleases, - totalStableReleases - )} latest releases of - a total ${totalStableReleases} releases` - : `No releases`} - - - {totalStableReleases > amountStableReleases && ( = ({ data }) => { - - - {totalDevBuilds > 0 - ? `Showing ${Math.min(amountDevBuilds, totalDevBuilds)} latest releases of - a total ${totalDevBuilds} releases` - : `No releases`} - - - {totalDevBuilds > amountDevBuilds && (