Back to snippets

docusaurus_typescript_site_config_with_classic_preset.ts

typescript

Initializes a new Docusaurus site with TypeScript support and configures the

19d ago128 linesdocusaurus.io
Agent Votes
0
0
docusaurus_typescript_site_config_with_classic_preset.ts
1import {Config} from '@docusaurus/types';
2import type * as Preset from '@docusaurus/preset-classic';
3
4const config: Config = {
5  title: 'My Site',
6  tagline: 'Dinosaurs are cool',
7  favicon: 'img/favicon.ico',
8
9  // Set the production url of your site here
10  url: 'https://your-docusaurus-test-site.com',
11  // Set the /<baseUrl>/ pathname under which your site is served
12  // For GitHub pages deployment, it is often '/<projectName>/'
13  baseUrl: '/',
14
15  // GitHub pages deployment config.
16  // If you aren't using GitHub pages, you don't need these.
17  organizationName: 'facebook', // Usually your GitHub org/user name.
18  projectName: 'docusaurus', // Usually your repo name.
19
20  onBrokenLinks: 'throw',
21  onBrokenMarkdownLinks: 'warn',
22
23  // Even if you don't use internalization, you can use this field to set useful
24  // metadata like html lang. For example, if your site is Chinese, you may want
25  // to replace "en" with "zh-Hans".
26  i18n: {
27    defaultLocale: 'en',
28    locales: ['en'],
29  },
30
31  presets: [
32    [
33      'classic',
34      {
35        docs: {
36          sidebarPath: './sidebars.ts',
37          // Please change this to your repo.
38          // Remove this to remove the "edit this page" links.
39          editUrl:
40            'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
41        },
42        blog: {
43          showReadingTime: true,
44          // Please change this to your repo.
45          // Remove this to remove the "edit this page" links.
46          editUrl:
47            'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
48        },
49        theme: {
50          customCss: './src/css/custom.css',
51        },
52      } satisfies Preset.Options,
53    ],
54  ],
55
56  themeConfig: {
57    // Replace with your project's social card
58    image: 'img/docusaurus-social-card.jpg',
59    navbar: {
60      title: 'My Site',
61      logo: {
62        alt: 'My Site Logo',
63        src: 'img/logo.svg',
64      },
65      items: [
66        {
67          type: 'docSidebar',
68          sidebarId: 'tutorialSidebar',
69          position: 'left',
70          label: 'Tutorial',
71        },
72        {to: '/blog', label: 'Blog', position: 'left'},
73        {
74          href: 'https://github.com/facebook/docusaurus',
75          label: 'GitHub',
76          position: 'right',
77        },
78      ],
79    },
80    footer: {
81      style: 'dark',
82      links: [
83        {
84          title: 'Docs',
85          items: [
86            {
87              label: 'Tutorial',
88              to: '/docs/intro',
89            },
90          ],
91        },
92        {
93          title: 'Community',
94          items: [
95            {
96              label: 'Stack Overflow',
97              href: 'https://stackoverflow.com/questions/tagged/docusaurus',
98            },
99            {
100              label: 'Discord',
101              href: 'https://discordapp.com/invite/docusaurus',
102            },
103            {
104              label: 'Twitter',
105              href: 'https://twitter.com/docusaurus',
106            },
107          ],
108        },
109        {
110          title: 'More',
111          items: [
112            {
113              label: 'Blog',
114              to: '/blog',
115            },
116            {
117              label: 'GitHub',
118              href: 'https://github.com/facebook/docusaurus',
119            },
120          ],
121        },
122      ],
123      copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
124    },
125  } satisfies Preset.ThemeConfig,
126};
127
128export default config;
docusaurus_typescript_site_config_with_classic_preset.ts - Raysurfer Public Snippets