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

chore(docusaurus): JP - update to latest #3054

Merged
merged 19 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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: 0 additions & 2 deletions docusaurus-theme-classic/.gitignore

This file was deleted.

23,149 changes: 0 additions & 23,149 deletions docusaurus-theme-classic/package-lock.json

This file was deleted.

14 changes: 0 additions & 14 deletions docusaurus-theme-classic/package.json

This file was deleted.

54 changes: 0 additions & 54 deletions docusaurus-theme-classic/src/index.js

This file was deleted.

141 changes: 66 additions & 75 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,53 @@ module.exports = {
favicon: 'img/meta/favicon-96x96.png',
organizationName: 'ionic-team',
projectName: 'ionic-docs',
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
{
// Will be passed to @docusaurus/plugin-content-docs (false to disable)
docs: {
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: ({ versionDocsDirPath, docPath, locale }) => {
if (locale != 'en') {
return 'https://crowdin.com/project/ionic-docs';
}
if ((match = docPath.match(/api\/(.*)\.md/)) != null) {
return `https://github.com/ionic-team/ionic-docs/tree/main/docs/api/${match[1]}.md`;
}
if ((match = docPath.match(/cli\/commands\/(.*)\.md/)) != null) {
return `https://github.com/ionic-team/ionic-cli/edit/develop/packages/@ionic/cli/src/commands/${match[1].replace(
'-',
'/'
)}.ts`;
}
if ((match = docPath.match(/native\/(.*)\.md/)) != null) {
return `https://github.com/ionic-team/capacitor-plugins/edit/main/${match[1]}/README.md`;
}
return `https://github.com/ionic-team/ionic-docs/edit/main/${versionDocsDirPath}/${docPath}`;
},
exclude: ['README.md'],
lastVersion: 'current',
versions: {
current: {
label: 'v7',
},
},
},
// Will be passed to @docusaurus/theme-classic.
theme: {
customCss: [
require.resolve('./node_modules/modern-normalize/modern-normalize.css'),
require.resolve('./node_modules/@ionic-internal/ionic-ds/dist/tokens/tokens.css'),
require.resolve('./src/styles/custom.scss'),
],
},
},
],
],
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
themeConfig: {
metadata: [
{ name: 'og:image', content: 'https://ionicframework.com/docs/img/meta/open-graph.png' },
Expand Down Expand Up @@ -98,10 +145,10 @@ module.exports = {
position: 'left',
},
{
type: 'cta',
position: 'left',
text: 'Ionic採用事例をみよう',
href: `https://ionicframework.jp/case/`,
label: 'Ionic採用事例をみよう',
position: 'left',
className: 'cta',
},
{
type: 'docsVersionDropdown',
Expand Down Expand Up @@ -180,8 +227,9 @@ module.exports = {
className: 'navbar__link--support',
},
{
type: 'separator',
type: 'html',
position: 'right',
value: '<div class="separator" />',
},
{
type: 'localeDropdown',
Expand All @@ -198,34 +246,25 @@ module.exports = {
className: 'icon-link language navbar__item',
},
{
type: 'iconLink',
href: 'https://twitter.com/Ionicframework',
position: 'right',
icon: {
alt: 'twitter logo',
src: `/logos/twitter.svg`,
href: 'https://twitter.com/Ionicframework',
target: '_blank',
},
className: 'icon-link icon-link-mask icon-link-twitter',
'aria-label': 'Twitter',
target: '_blank',
},
{
type: 'iconLink',
href: 'https://github.com/ionic-team/ionic-framework',
position: 'right',
icon: {
alt: 'github logo',
src: `/logos/github.svg`,
href: 'https://github.com/ionic-team/ionic-framework',
target: '_blank',
},
className: 'icon-link icon-link-mask icon-link-github',
'aria-label': 'GitHub repository',
target: '_blank',
},
{
type: 'iconLink',
href: 'https://ionic.link/discord',
position: 'right',
icon: {
alt: 'discord logo',
src: `/logos/discord.svg`,
href: 'https://ionic.link/discord',
target: '_blank',
},
className: 'icon-link icon-link-mask icon-link-discord',
'aria-label': 'Discord',
target: '_blank',
},
],
},
Expand All @@ -234,7 +273,7 @@ module.exports = {
},
prism: {
theme: { plain: {}, styles: [] },
// https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/vendor/prism/includeLangs.js
// https://github.com/FormidableLabs/prism-react-renderer/blob/5a1c93592c6475fb230bfcb8a9666b72b331638b/packages/generate-prism-languages/index.ts#L9-L24
additionalLanguages: ['shell-session', 'http'],
},
algolia: {
Expand All @@ -257,41 +296,6 @@ module.exports = {
},
},
],
[
'@docusaurus/plugin-content-docs',
{
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: ({ versionDocsDirPath, docPath, locale }) => {
if (locale != 'en') {
return 'https://crowdin.com/project/ionic-docs';
}
if ((match = docPath.match(/api\/(.*)\.md/)) != null) {
return `https://github.com/ionic-team/ionic-docs/tree/main/docs/api/${match[1]}.md`;
}
if ((match = docPath.match(/cli\/commands\/(.*)\.md/)) != null) {
return `https://github.com/ionic-team/ionic-cli/edit/develop/packages/@ionic/cli/src/commands/${match[1].replace(
'-',
'/'
)}.ts`;
}
if ((match = docPath.match(/native\/(.*)\.md/)) != null) {
return `https://github.com/ionic-team/capacitor-plugins/edit/main/${match[1]}/README.md`;
}
return `https://github.com/ionic-team/ionic-docs/edit/main/${versionDocsDirPath}/${docPath}`;
},
exclude: ['README.md'],
lastVersion: 'current',
versions: {
current: {
label: 'v7',
},
},
},
],
'@docusaurus/plugin-content-pages',
'@docusaurus/plugin-debug',
'@docusaurus/plugin-sitemap',
'@ionic-internal/docusaurus-plugin-tag-manager',
function (context, options) {
return {
Expand All @@ -317,19 +321,6 @@ module.exports = {
},
],
],
themes: [
[
//overriding the standard docusaurus-theme-classic to provide custom schema
path.resolve(__dirname, 'docusaurus-theme-classic'),
{
customCss: [
require.resolve('./node_modules/modern-normalize/modern-normalize.css'),
require.resolve('./node_modules/@ionic-internal/ionic-ds/dist/tokens/tokens.css'),
require.resolve('./src/styles/custom.scss'),
],
},
],
path.resolve(__dirname, './node_modules/@docusaurus/theme-search-algolia'),
],
customFields: {},
themes: [],
};
Loading