Skip to content

Commit

Permalink
docs: upgrade Docusaurus to v3 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar authored Feb 7, 2025
1 parent 80c5768 commit 5ca7858
Show file tree
Hide file tree
Showing 8 changed files with 14,200 additions and 17,924 deletions.
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

0 comments on commit 5ca7858

Please sign in to comment.