Skip to content

Commit

Permalink
feat: update config
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Nov 20, 2023
1 parent 2800124 commit 1e2bd25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
18 changes: 6 additions & 12 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const {themes} = require('prism-react-renderer');
const lightTheme = themes.github;
const darkTheme = themes.dracula;

const config: Config = {
title: 'Apache TVM 中文站',
tagline: 'Apache TVM 是一个端到端的深度学习编译框架,适用于 CPU、GPU 和各种机器学习加速芯片。',
Expand All @@ -34,7 +28,7 @@ const config: Config = {
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: './sidebars.ts',
// Please change this to your repo.
editUrl: 'https://github.com/hyperai/tvm-cn/edit/master/',
showLastUpdateAuthor: true,
Expand All @@ -57,7 +51,7 @@ const config: Config = {
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/app.scss'),
customCss: './src/css/app.scss',
},
} satisfies Preset.Options,
],
Expand Down Expand Up @@ -116,8 +110,8 @@ const config: Config = {
copyright: ${new Date().getFullYear()} Apache Software Foundation and Hyper.AI for Chinese Simplified mirror`,
},
prism: {
theme: lightTheme,
darkTheme: darkTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
// https://docusaurus.io/docs/migration/v3#prism-react-renderer-v20
additionalLanguages: ['bash', 'diff', 'json', 'python'],
},
Expand All @@ -144,7 +138,7 @@ const config: Config = {

plugins: [
'docusaurus-plugin-sass',
require.resolve('./src/plugins/typekit/'),
'./src/plugins/typekit/',
],
scripts: [
{
Expand Down
9 changes: 4 additions & 5 deletions sidebars.js → sidebars.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
Expand All @@ -9,10 +11,7 @@
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
const sidebars: SidebarsConfig = {
// By default, Docusaurus generates a sidebar from the docs folder structure
/*
tutorialSidebar: [
Expand Down Expand Up @@ -143,4 +142,4 @@ const sidebars = {
]
};

module.exports = sidebars;
export default sidebars;

0 comments on commit 1e2bd25

Please sign in to comment.