github.com/cosmos/cosmos-sdk@v0.50.10/docs/docusaurus.config.js (about)

     1  // @ts-check
     2  // Note: type annotations allow type checking and IDEs autocompletion
     3  
     4  const lightCodeTheme = require("prism-react-renderer/themes/github");
     5  const darkCodeTheme = require("prism-react-renderer/themes/dracula");
     6  
     7  const lastVersion = "current";
     8  // const lastVersion = "v0.50";
     9  
    10  /** @type {import('@docusaurus/types').Config} */
    11  const config = {
    12    title: "Cosmos SDK",
    13    tagline:
    14      "Cosmos SDK is the world's most popular framework for building application-specific blockchains.",
    15    url: "https://docs.cosmos.network",
    16    baseUrl: "/",
    17    onBrokenLinks: "warn",
    18    onBrokenMarkdownLinks: "warn",
    19    favicon: "img/favicon.svg",
    20    trailingSlash: false,
    21  
    22    // GitHub pages deployment config.
    23    // If you aren't using GitHub pages, you don't need these.
    24    organizationName: "cosmos",
    25    projectName: "cosmos-sdk",
    26  
    27    // Even if you don't use internalization, you can use this field to set useful
    28    // metadata like html lang. For example, if your site is Chinese, you may want
    29    // to replace "en" with "zh-Hans".
    30    i18n: {
    31      defaultLocale: "en",
    32      locales: ["en"],
    33    },
    34  
    35    presets: [
    36      [
    37        "classic",
    38        /** @type {import('@docusaurus/preset-classic').Options} */
    39        ({
    40          docs: {
    41            sidebarPath: require.resolve("./sidebars.js"),
    42            routeBasePath: "/",
    43            lastVersion: lastVersion,
    44            versions: {
    45              current: {
    46                path: "main",
    47                // banner: "unreleased",
    48              },
    49              // "v0.50": {
    50              //   path: "v0.50",
    51              //   label: "v0.50",
    52              // },
    53            },
    54          },
    55          theme: {
    56            customCss: require.resolve("./src/css/custom.css"),
    57          },
    58        }),
    59      ],
    60    ],
    61  
    62    themeConfig:
    63      /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
    64      ({
    65        image: "img/banner.jpg",
    66        docs: {
    67          sidebar: {
    68            autoCollapseCategories: true,
    69          },
    70        },
    71        navbar: {
    72          title: "Cosmos SDK",
    73          hideOnScroll: false,
    74          logo: {
    75            alt: "Cosmos SDK Logo",
    76            src: "img/logo-sdk.svg",
    77            href: "https://docs.cosmos.network",
    78            target: "_self",
    79          },
    80          items: [
    81            {
    82              href: "https://github.com/cosmos/cosmos-sdk",
    83              html: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="github-icon">
    84              <path fill-rule="evenodd" clip-rule="evenodd" d="M12 0.300049C5.4 0.300049 0 5.70005 0 12.3001C0 17.6001 3.4 22.1001 8.2 23.7001C8.8 23.8001 9 23.4001 9 23.1001C9 22.8001 9 22.1001 9 21.1001C5.7 21.8001 5 19.5001 5 19.5001C4.5 18.1001 3.7 17.7001 3.7 17.7001C2.5 17.0001 3.7 17.0001 3.7 17.0001C4.9 17.1001 5.5 18.2001 5.5 18.2001C6.6 20.0001 8.3 19.5001 9 19.2001C9.1 18.4001 9.4 17.9001 9.8 17.6001C7.1 17.3001 4.3 16.3001 4.3 11.7001C4.3 10.4001 4.8 9.30005 5.5 8.50005C5.5 8.10005 5 6.90005 5.7 5.30005C5.7 5.30005 6.7 5.00005 9 6.50005C10 6.20005 11 6.10005 12 6.10005C13 6.10005 14 6.20005 15 6.50005C17.3 4.90005 18.3 5.30005 18.3 5.30005C19 7.00005 18.5 8.20005 18.4 8.50005C19.2 9.30005 19.6 10.4001 19.6 11.7001C19.6 16.3001 16.8 17.3001 14.1 17.6001C14.5 18.0001 14.9 18.7001 14.9 19.8001C14.9 21.4001 14.9 22.7001 14.9 23.1001C14.9 23.4001 15.1 23.8001 15.7 23.7001C20.5 22.1001 23.9 17.6001 23.9 12.3001C24 5.70005 18.6 0.300049 12 0.300049Z" fill="currentColor"/>
    85              </svg>
    86              `,
    87              position: "right",
    88            },
    89            {
    90              type: "docsVersionDropdown",
    91              position: "left",
    92              dropdownActiveClassDisabled: true,
    93              // versions not yet migrated to docusaurus
    94              dropdownItemsAfter: [
    95                {
    96                  href: "https://docs.cosmos.network/v0.46/",
    97                  label: "v0.46",
    98                  target: "_self",
    99                },
   100                {
   101                  href: "https://docs.cosmos.network/v0.45/",
   102                  label: "v0.45",
   103                  target: "_self",
   104                },
   105              ],
   106            },
   107          ],
   108        },
   109        footer: {
   110          links: [
   111            {
   112              items: [
   113                {
   114                  html: `<a href="https://cosmos.network"><img src="/img/logo-bw.svg" alt="Cosmos Logo"></a>`,
   115                },
   116              ],
   117            },
   118            {
   119              title: "Documentation",
   120              items: [
   121                {
   122                  label: "Cosmos Hub",
   123                  href: "https://hub.cosmos.network",
   124                },
   125                {
   126                  label: "CometBFT",
   127                  href: "https://docs.cometbft.com",
   128                },
   129                {
   130                  label: "IBC Go",
   131                  href: "https://ibc.cosmos.network",
   132                },
   133              ],
   134            },
   135            {
   136              title: "Community",
   137              items: [
   138                {
   139                  label: "Blog",
   140                  href: "https://blog.cosmos.network",
   141                },
   142                {
   143                  label: "Forum",
   144                  href: "https://forum.cosmos.network",
   145                },
   146                {
   147                  label: "Discord",
   148                  href: "https://discord.gg/cosmosnetwork",
   149                },
   150                {
   151                  label: "Reddit",
   152                  href: "https://reddit.com/r/cosmosnetwork",
   153                },
   154              ],
   155            },
   156            {
   157              title: "Social",
   158              items: [
   159                {
   160                  label: "Discord",
   161                  href: "https://discord.gg/cosmosnetwork",
   162                },
   163                {
   164                  label: "Twitter",
   165                  href: "https://twitter.com/cosmos",
   166                },
   167                {
   168                  label: "Youtube",
   169                  href: "https://www.youtube.com/c/CosmosProject",
   170                },
   171                {
   172                  label: "Telegram",
   173                  href: "https://t.me/cosmosproject",
   174                },
   175              ],
   176            },
   177          ],
   178          copyright: `<p>The development of the Cosmos SDK is led primarily by <a href="https://interchain.io/ecosystem">Interchain Core Teams</a>. Funding for this development comes primarily from the Interchain Foundation, a Swiss non-profit.</p>`,
   179        },
   180        prism: {
   181          theme: lightCodeTheme,
   182          darkTheme: darkCodeTheme,
   183          additionalLanguages: ["protobuf", "go-module"], // https://prismjs.com/#supported-languages
   184        },
   185        algolia: {
   186          appId: "QLS2QSP47E",
   187          apiKey: "4d9feeb481e3cfef8f91bbc63e090042",
   188          indexName: "cosmos_network",
   189          contextualSearch: false,
   190        },
   191      }),
   192    themes: ["@you54f/theme-github-codeblock"],
   193    plugins: [
   194      async function myPlugin(context, options) {
   195        return {
   196          name: "docusaurus-tailwindcss",
   197          configurePostCss(postcssOptions) {
   198            postcssOptions.plugins.push(require("postcss-import"));
   199            postcssOptions.plugins.push(require("tailwindcss/nesting"));
   200            postcssOptions.plugins.push(require("tailwindcss"));
   201            postcssOptions.plugins.push(require("autoprefixer"));
   202            return postcssOptions;
   203          },
   204        };
   205      },
   206      [
   207        "@docusaurus/plugin-google-analytics",
   208        {
   209          trackingID: "UA-51029217-2",
   210          anonymizeIP: true,
   211        },
   212      ],
   213      [
   214        "@docusaurus/plugin-client-redirects",
   215        {
   216          fromExtensions: ["html"],
   217          toExtensions: ["html"],
   218          createRedirects(existingPath) {
   219            return [
   220              existingPath.replace('/core', '/learn/advanced'),
   221              existingPath.replace('/basics', '/learn/beginner'),
   222              existingPath.replace('/intro', '/learn/intro'),
   223              existingPath.replace('/architecture', '/build/architecture/'),
   224              existingPath.replace('/building-apps', '/build/building-apps'),
   225              existingPath.replace('/building-modules', '/build/building-modules'),
   226              existingPath.replace('/tooling', '/build/tooling'),
   227              existingPath.replace('/migrations', '/build/migrations'),
   228              existingPath.replace('/modules', '/build/modules'),
   229              existingPath.replace('/rfc', '/build/rfc'),
   230              existingPath.replace('/spec', '/build/spec'),
   231              existingPath.replace('/tooling', '/build/tooling'),
   232              existingPath.replace('/run-node', '/user/run-node'),
   233              existingPath.replace('/validate', '/user/validate')
   234            ];
   235          },
   236          redirects: [
   237            {
   238              from: ["/", "/master", "/v0.43", "/v0.44"],
   239              to: "/main",
   240            },
   241            {
   242              from: [
   243                "/main/modules/auth/01_concepts",
   244                "/main/modules/auth/02_state",
   245                "/main/modules/auth/03_antehandlers",
   246                "/main/modules/auth/04_keepers",
   247                "/main/modules/auth/06_params",
   248                "/main/modules/auth/07_client",
   249              ],
   250              to: "/main/build/modules/auth",
   251            },
   252            {
   253              from: "/main/modules/auth/05_vesting",
   254              to: "/main/build/modules/auth/vesting",
   255            },
   256            {
   257              from: [
   258                "/main/modules/authz/01_concepts",
   259                "/main/modules/authz/02_state",
   260                "/main/modules/authz/03_messages",
   261                "/main/modules/authz/04_events",
   262                "/main/modules/authz/05_client",
   263              ],
   264              to: "/main/build/modules/authz",
   265            },
   266            {
   267              from: [
   268                "/main/modules/bank/01_state",
   269                "/main/modules/bank/02_keepers",
   270                "/main/modules/bank/04_events",
   271                "/main/modules/bank/05_params",
   272                "/main/modules/bank/06_client",
   273              ],
   274              to: "/main/build/modules/bank",
   275            },
   276            {
   277              from: [
   278                "/main/modules/crisis/01_state",
   279                "/main/modules/crisis/02_messages",
   280                "/main/modules/crisis/03_events",
   281                "/main/modules/crisis/04_params",
   282                "/main/modules/crisis/05_client",
   283              ],
   284              to: "/main/build/modules/crisis",
   285            },
   286            {
   287              from: [
   288                "/main/modules/distribution/01_concepts",
   289                "/main/modules/distribution/02_state",
   290                "/main/modules/distribution/03_begin_block",
   291                "/main/modules/distribution/04_messages",
   292                "/main/modules/distribution/05_hooks",
   293                "/main/modules/distribution/06_events",
   294                "/main/modules/distribution/07_params",
   295                "/main/modules/distribution/08_client",
   296              ],
   297              to: "/main/build/modules/distribution",
   298            },
   299            {
   300              from: [
   301                "/main/modules/evidence/01_concepts",
   302                "/main/modules/evidence/02_state",
   303                "/main/modules/evidence/03_messages",
   304                "/main/modules/evidence/04_events",
   305                "/main/modules/evidence/05_params",
   306                "/main/modules/evidence/06_begin_block",
   307                "/main/modules/evidence/07_client",
   308              ],
   309              to: "/main/build/modules/evidence",
   310            },
   311            {
   312              from: [
   313                "/main/modules/feegrant/01_concepts",
   314                "/main/modules/feegrant/02_state",
   315                "/main/modules/feegrant/03_messages",
   316                "/main/modules/feegrant/04_events",
   317                "/main/modules/feegrant/05_client",
   318              ],
   319              to: "/main/build/modules/feegrant",
   320            },
   321            {
   322              from: [
   323                "/main/modules/gov/01_concepts",
   324                "/main/modules/gov/02_state",
   325                "/main/modules/gov/03_messages",
   326                "/main/modules/gov/04_events",
   327                "/main/modules/gov/05_future_improvements",
   328                "/main/modules/gov/06_params",
   329                "/main/modules/gov/07_client",
   330                "/main/modules/gov/08_metadata",
   331              ],
   332              to: "/main/build/modules/gov",
   333            },
   334            {
   335              from: [
   336                "/main/modules/group/01_concepts",
   337                "/main/modules/group/02_state",
   338                "/main/modules/group/03_messages",
   339                "/main/modules/group/04_events",
   340                "/main/modules/group/05_client",
   341                "/main/modules/group/06_metadata",
   342              ],
   343              to: "/main/build/modules/group/",
   344            },
   345            {
   346              from: [
   347                "/main/modules/mint/01_concepts",
   348                "/main/modules/mint/02_state",
   349                "/main/modules/mint/03_begin_block",
   350                "/main/modules/mint/04_params",
   351                "/main/modules/mint/05_events",
   352                "/main/modules/mint/06_client",
   353              ],
   354              to: "/main/build/modules/mint/",
   355            },
   356            {
   357              from: [
   358                "/main/modules/nft/01_concepts",
   359                "/main/modules/nft/02_state",
   360                "/main/modules/nft/03_messages",
   361                "/main/modules/nft/04_events",
   362              ],
   363              to: "/main/build/modules/nft/",
   364            },
   365            {
   366              from: [
   367                "/main/modules/params/01_keeper",
   368                "/main/modules/params/02_subspace",
   369              ],
   370              to: "/main/build/modules/params/",
   371            },
   372            {
   373              from: [
   374                "/main/modules/slashing/01_concepts",
   375                "/main/modules/slashing/02_state",
   376                "/main/modules/slashing/03_messages",
   377                "/main/modules/slashing/04_begin_block",
   378                "/main/modules/slashing/05_hooks",
   379                "/main/modules/slashing/06_events",
   380                "/main/modules/slashing/07_tombstone",
   381                "/main/modules/slashing/08_params",
   382                "/main/modules/slashing/09_client",
   383              ],
   384              to: "/main/build/modules/slashing/",
   385            },
   386            {
   387              from: [
   388                "/main/modules/staking/01_state",
   389                "/main/modules/staking/02_state_transitions",
   390                "/main/modules/staking/03_messages",
   391                "/main/modules/staking/04_begin_block",
   392                "/main/modules/staking/05_end_block",
   393                "/main/modules/staking/06_hooks",
   394                "/main/modules/staking/07_events",
   395                "/main/modules/staking/08_params",
   396                "/main/modules/staking/09_client",
   397              ],
   398              to: "/main/build/modules/staking/",
   399            },
   400            {
   401              from: [
   402                "/main/modules/upgrade/01_concepts",
   403                "/main/modules/upgrade/02_state",
   404                "/main/modules/upgrade/03_events",
   405                "/main/modules/upgrade/04_client",
   406              ],
   407              to: "/main/build/modules/upgrade/",
   408            },
   409            {
   410              from: ["/main/modules/capability", "/main/ecosystem"],
   411              to: "/main/build/modules/auth",
   412            },
   413            {
   414              from: ["/main/spec/circuit-breaker"],
   415              to: "/main/build/modules/circuit",
   416            },
   417            {
   418              from: ["/main/spec/reserve-pool"],
   419              to: "/main/build/modules/distribution",
   420            },
   421            {
   422              from: ["/main/run-node/cosmovisor"],
   423              to: "/main/build/tooling/cosmovisor",
   424            },
   425            {
   426              from: ["/main/migrations/pre-upgrade"],
   427              to: "/main/build/building-apps/app-upgrade",
   428            },
   429            {
   430              from: ["/main/tooling/depinject"],
   431              to: "/main/build/packages/depinject",
   432            },
   433            {
   434              from: ["/main/building-modules/autocli"],
   435              to: "/main/learn/advanced/autocli",
   436            },
   437          ],
   438        },
   439      ],
   440    ],
   441  };
   442  
   443  module.exports = config;