layout.config.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { type DocsLayoutProps } from "fumadocs-ui/layouts/notebook";
  2. import { type HomeLayoutProps } from "fumadocs-ui/layouts/home";
  3. import { docsSource } from "./source";
  4. import StackExchangeIcon from "@/public/icons/stackexchange.svg";
  5. import GithubIcon from "@/public/icons/github.svg";
  6. import DiscordIcon from "@/public/icons/discord.svg";
  7. import Image from "next/image";
  8. /**
  9. * Shared layout configurations
  10. *
  11. * you can configure layouts individually from:
  12. * Home Layout: app/(home)/layout.tsx
  13. * Docs Layout: app/docs/layout.tsx
  14. */
  15. export const baseOptions: HomeLayoutProps = {
  16. nav: {
  17. title: (
  18. <div className="flex items-center gap-2 pl-2">
  19. <Image src="/icons/anchor.png" alt="Logo" width={24} height={24} />
  20. <span>Anchor Docs</span>
  21. </div>
  22. ),
  23. url: "/docs",
  24. },
  25. links: [
  26. {
  27. icon: <GithubIcon />,
  28. text: "Github",
  29. url: "https://github.com/coral-xyz/anchor",
  30. active: "none",
  31. },
  32. {
  33. icon: <DiscordIcon />,
  34. text: "Discord",
  35. url: "https://discord.com/invite/NHHGSXAnXk",
  36. active: "none",
  37. },
  38. {
  39. icon: <StackExchangeIcon />,
  40. text: "Stack Exchange",
  41. url: "https://solana.stackexchange.com/",
  42. active: "none",
  43. },
  44. ],
  45. };
  46. export const docsOptions: DocsLayoutProps = {
  47. ...baseOptions,
  48. sidebar: {
  49. defaultOpenLevel: 1,
  50. },
  51. tree: docsSource.pageTree,
  52. };