|
| 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 | +/** @type {import('@docusaurus/types').Config} */ |
| 8 | +const config = { |
| 9 | + title: 'templ docs', |
| 10 | + tagline: 'A language for writing HTML user interfaces in Go. ', |
| 11 | + favicon: 'img/favicon.ico', |
| 12 | + |
| 13 | + // Set the production url of your site here |
| 14 | + url: 'https://templ.guide', |
| 15 | + // Set the /<baseUrl>/ pathname under which your site is served |
| 16 | + // For GitHub pages deployment, it is often '/<projectName>/' |
| 17 | + baseUrl: '/', |
| 18 | + |
| 19 | + // GitHub pages deployment config. |
| 20 | + // If you aren't using GitHub pages, you don't need these. |
| 21 | + organizationName: 'a-h', // Usually your GitHub org/user name. |
| 22 | + projectName: 'templ', // Usually your repo name. |
| 23 | + |
| 24 | + onBrokenLinks: 'throw', |
| 25 | + onBrokenMarkdownLinks: 'warn', |
| 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 | + // Please change this to your repo. |
| 44 | + // Remove this to remove the "edit this page" links. |
| 45 | + editUrl: |
| 46 | + 'https://github.com/a-h/templ/tree/main/docs/', |
| 47 | + }, |
| 48 | + blog: false, |
| 49 | + theme: { |
| 50 | + customCss: require.resolve('./src/css/custom.css'), |
| 51 | + }, |
| 52 | + }), |
| 53 | + ], |
| 54 | + ], |
| 55 | + |
| 56 | + themeConfig: |
| 57 | + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ |
| 58 | + ({ |
| 59 | + // Replace with your project's social card |
| 60 | + image: 'img/docusaurus-social-card.jpg', |
| 61 | + navbar: { |
| 62 | + logo: { |
| 63 | + alt: 'Templ Logo', |
| 64 | + src: 'img/logo.svg', |
| 65 | + }, |
| 66 | + items: [ |
| 67 | + { |
| 68 | + type: 'docSidebar', |
| 69 | + sidebarId: 'tutorialSidebar', |
| 70 | + position: 'left', |
| 71 | + label: 'Docs', |
| 72 | + }, |
| 73 | + { |
| 74 | + href: 'https://github.com/a-h/templ', |
| 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: 'Introduction', |
| 88 | + to: '/', |
| 89 | + }, |
| 90 | + { |
| 91 | + label: 'Getting Started', |
| 92 | + to: '/category/getting-started', |
| 93 | + }, |
| 94 | + ], |
| 95 | + }, |
| 96 | + ], |
| 97 | + copyright: `Copyright © ${new Date().getFullYear()} Adrian Hesketh, Built with Docusaurus.`, |
| 98 | + }, |
| 99 | + prism: { |
| 100 | + theme: lightCodeTheme, |
| 101 | + darkTheme: darkCodeTheme, |
| 102 | + }, |
| 103 | + }), |
| 104 | +}; |
| 105 | + |
| 106 | +module.exports = config; |
0 commit comments