Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: upgrade Docusaurus to v3 #315

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Install dependencies
working-directory: website
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Install docs dependencies
working-directory: website
Expand Down
3 changes: 0 additions & 3 deletions website/babel.config.js

This file was deleted.

27 changes: 11 additions & 16 deletions website/docusaurus.config.js → website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";
import { themes } from "prism-react-renderer";
import { PluginOptions } from "@easyops-cn/docusaurus-search-local";

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
const config: Config = {
title: 'Crowdin iOS SDK',
tagline: 'Crowdin iOS SDK delivers all new translations from Crowdin project to the application immediately',
favicon: 'img/favicon.ico',
Expand All @@ -25,8 +23,7 @@ const config = {

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
'@docusaurus/preset-classic',
({
docs: {
routeBasePath: '/',
Expand All @@ -36,24 +33,22 @@ const config = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
} satisfies Preset.Options),
],
],

themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
({
hashed: true,
docsRouteBasePath: '/',
indexBlog: false,
}),
} satisfies PluginOptions),
]
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'Crowdin iOS SDK',
Expand Down Expand Up @@ -98,11 +93,11 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} Crowdin.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: themes.github,
darkTheme: themes.dracula,
additionalLanguages: ['bash', 'swift', 'objectivec']
},
}),
} satisfies Preset.ThemeConfig),
};

module.exports = config;
Loading
Loading