Skip to content
Draft
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
34 changes: 11 additions & 23 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ const ARCHIVED_VERSIONS_JSON = require('./versionsArchived.json');
* containing the version name at index 0 and
* the archive url at index 1.
*/
const ArchivedVersionsDropdownItems = Object.entries(ARCHIVED_VERSIONS_JSON).splice(0, 5);
const ArchivedVersionsDropdownItems = Object.entries(ARCHIVED_VERSIONS_JSON).slice(0, 5);

const BASE_URL = '/docs';

/** @type {import('@docusaurus/types').Config} */
module.exports = {
title: 'Ionic Framework',
tagline:
Expand Down Expand Up @@ -84,8 +85,6 @@ module.exports = {
},
},
favicon: 'img/meta/favicon-96x96.png',
organizationName: 'ionic-team',
projectName: 'ionic-docs',
presets: [
[
'@docusaurus/preset-classic',
Expand All @@ -100,12 +99,8 @@ module.exports = {
return 'https://crowdin.com/project/ionic-docs';
}
let match;
// Anchored on the extension so an `.mdx` page cannot match the `.md` branch and
// produce a link to a file that no longer exists. The api pages carry whichever
// extension the source uses; the cli and native pages are generated and stay `.md`.
if ((match = docPath.match(/api\/(.*)\.(mdx?)$/)) != null) {
return `https://github.com/ionic-team/ionic-docs/tree/main/docs/api/${match[1]}.${match[2]}`;
}
// The cli and native pages are generated from other repos, so they link to
// their source there.
if ((match = docPath.match(/cli\/commands\/(.*)\.mdx?$/)) != null) {
return `https://github.com/ionic-team/ionic-cli/edit/develop/packages/@ionic/cli/src/commands/${match[1].replace(
'-',
Expand All @@ -128,7 +123,6 @@ module.exports = {
'**/__tests__/**',
],
lastVersion: 'current',
/** @type {import('@docusaurus/plugin-content-docs').VersionOptions} */
versions: {
current: {
label: 'v9',
Expand Down Expand Up @@ -158,13 +152,10 @@ module.exports = {
'<a href="https://www.outsystems.com/?utm_source=ionic&utm_medium=referral&utm_campaign=ionic-referral&utm_term=none&utm_content=other&utm_campaignteam=digital-mktg&utm_partner=none" target="_blank" rel="noopener"><span>An <strong>OutSystems</strong> Company →</span></a>',
isCloseable: false,
},
// Docusaurus outputs it as `og:image` and `twitter:image`, and sets
// `twitter:card` to `summary_large_image`.
image: 'https://ionicframework.com/docs/img/meta/open-graph.png',
metadata: [
{ name: 'og:image', content: 'https://ionicframework.com/docs/img/meta/open-graph.png' },
{ name: 'twitter:image', content: 'https://ionicframework.com/docs/img/meta/open-graph.png' },
{
name: 'twitter:card',
content: 'summary_large_image',
},
{
name: 'twitter:domain',
content: 'ionicframework.com',
Expand All @@ -182,11 +173,11 @@ module.exports = {
content: '1321836767955949',
},
{
name: 'og:type',
property: 'og:type',
content: 'website',
},
{
name: 'og:site_name',
property: 'og:site_name',
content: 'Ionic Framework Docs',
},
],
Expand Down Expand Up @@ -257,7 +248,6 @@ module.exports = {
{ to: 'https://ionicframework.com/docs/v4/components', label: 'v4', target: '_blank' },
{ to: 'https://ionicframework.com/docs/v3/', label: 'v3', target: '_blank' },
],
// dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],
dropdownActiveClassDisabled: true,
},
{
Expand Down Expand Up @@ -395,7 +385,7 @@ module.exports = {
},
},
],
function (context, options) {
function () {
return {
name: 'ionic-docs-ads',
async loadContent() {
Expand All @@ -407,7 +397,7 @@ module.exports = {

return await client.getByType('docs_ad');
},
async contentLoaded({ content, actions: { setGlobalData, addRoute } }) {
async contentLoaded({ content, actions: { setGlobalData } }) {
return setGlobalData({ prismicAds: content.results });
},
};
Expand All @@ -430,6 +420,4 @@ module.exports = {
],
path.resolve(__dirname, 'plugins', 'docusaurus-plugin-llms-txt'),
],
customFields: {},
themes: [],
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"build:production": "docusaurus build",
"clear": "docusaurus clear",
"crowdin:sync": "docusaurus write-translations && crowdin upload && crowdin download",
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
"generate-markdown": "node scripts/native.mjs && node scripts/cli.mjs && node scripts/release-notes.mjs",
"heading-ids": "docusaurus write-heading-ids . \"docs/**/*.mdx\" \"!docs/native/**\" \"!docs/cli/commands/**\" --syntax mdx-comment",
Expand Down
Loading