File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
plugins/docusaurus-plugin-ionic-component-api Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,21 @@ module.exports = function (context, options) {
2020 */
2121 const generateMarkdownForVersion = async ( version , npmTag , lang , isCurrentVersion ) => {
2222 let COMPONENT_LINK_REGEXP ;
23- const response =
24- isCurrentVersion && lang === 'ja'
25- ? await fetch ( `https://raw.githubusercontent.com/ionic-jp/ionic-docs/main/scripts/data/translated-api.json` )
26- : await fetch ( `https://unpkg.com/@ionic/docs@${ npmTag } /core.json` ) ;
27- const { components } = await response . json ( ) ;
23+ const components = await ( async ( ) => {
24+ if ( isCurrentVersion ) {
25+ const { components } = require ( process . cwd ( ) + `/scripts/data/translated-api.json` ) ;
26+ return components ;
27+ } else {
28+ const response = await fetch ( `https://unpkg.com/@ionic/docs@${ npmTag } /core.json` ) ;
29+ const { components } = await response . json ( ) ;
30+ return components ;
31+ }
32+ } ) ( ) ;
33+ // const response =
34+ // isCurrentVersion && lang === 'ja'
35+ // ? await fetch(`https://raw.githubusercontent.com/ionic-jp/ionic-docs/main/scripts/data/translated-api.json`)
36+ // : await fetch(`https://unpkg.com/@ionic/docs@${npmTag}/core.json`);
37+ // const { components } = await response.json();
2838
2939 const names = components . map ( ( component ) => component . tag . slice ( 4 ) ) ;
3040 // matches all relative markdown links to a component, e.g. (../button)
You can’t perform that action at this time.
0 commit comments