From cfb04d11d2dc9b4ddd2e058294c31039030361e8 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Tue, 17 Nov 2026 20:04:39 -0800 Subject: [PATCH] chore(config): fix v8 edit links and social meta tags, remove unused options --- docusaurus.config.js | 34 +++++++++++----------------------- package.json | 1 - 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 08cc3387ab..37ce6a62ae 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -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: @@ -84,8 +85,6 @@ module.exports = { }, }, favicon: 'img/meta/favicon-96x96.png', - organizationName: 'ionic-team', - projectName: 'ionic-docs', presets: [ [ '@docusaurus/preset-classic', @@ -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( '-', @@ -128,7 +123,6 @@ module.exports = { '**/__tests__/**', ], lastVersion: 'current', - /** @type {import('@docusaurus/plugin-content-docs').VersionOptions} */ versions: { current: { label: 'v9', @@ -158,13 +152,10 @@ module.exports = { 'An OutSystems Company →', 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', @@ -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', }, ], @@ -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, }, { @@ -395,7 +385,7 @@ module.exports = { }, }, ], - function (context, options) { + function () { return { name: 'ionic-docs-ads', async loadContent() { @@ -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 }); }, }; @@ -430,6 +420,4 @@ module.exports = { ], path.resolve(__dirname, 'plugins', 'docusaurus-plugin-llms-txt'), ], - customFields: {}, - themes: [], }; diff --git a/package.json b/package.json index a803e65369..c9e7045aab 100644 --- a/package.json +++ b/package.json @@ -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",