Skip to content

Commit

Permalink
[docs]: fix sitemap, improve accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
HoHieuLuc committed Nov 12, 2023
1 parent 7615c8e commit 6a1de5d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MantineProvider, ColorSchemeScript } from '@mantine/core';
import Shell from '@/components/Shell/Shell';
import { ContextMenuProvider } from 'mantine-contextmenu';
import { theme } from './theme';
import { theme } from '../theme';
import { Metadata } from 'next';
import { SITE_TITLE } from '@/config';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function flattenRoutes(routes: Array<Route>): Array<string> {

export default function sitemap(): MetadataRoute.Sitemap {
const routes = flattenRoutes(ROUTES)
.filter((route) => route !== '/' || !route.startsWith('/'));
.filter((route) => route !== '/' && route.startsWith('/'));

return [
{
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/src/components/Shell/Navbar/NavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ const NavLink = ({ href, label, icon, iconProps, subLinks }: Route) => {
return (
<MNavLink
{...sharedProps}
defaultOpened={opened}
component='div'
classNames={{
children: classes.children,
}}
defaultOpened={opened}
>
{subLinks.map((link) => (
<MNavLink
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/src/theme/NavLink.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.label {
color: light-dark(var(--mantine-color-dark-7), var(--mantine-color-gray-2));
}
15 changes: 12 additions & 3 deletions apps/docs/src/app/theme.ts → apps/docs/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ import '@mantine/code-highlight/styles.layer.css';
import '@mantine/spotlight/styles.layer.css';
import '@mantine/tiptap/styles.layer.css';
import 'mantine-contextmenu/styles.layer.css';
import './layout.css';
import 'tiptap-extension-resizable-image/styles.css';
import '@/app/layout.css';
import '@/styles/editor.css';

import { createTheme } from '@mantine/core';
import { NavLink, createTheme } from '@mantine/core';
import navLinkClasses from './NavLink.module.css';

export const theme = createTheme({
/* Put your mantine theme override here */
components: {
NavLink: NavLink.extend({
defaultProps: {
classNames: {
label: navLinkClasses.label,
}
}
})
}
});

0 comments on commit 6a1de5d

Please sign in to comment.