diff --git a/addon/components/api/x-section/template.hbs b/addon/components/api/x-section/template.hbs index 4c43943ec..228c6b773 100644 --- a/addon/components/api/x-section/template.hbs +++ b/addon/components/api/x-section/template.hbs @@ -12,7 +12,7 @@ {{/if}} {{#if (or item.isClass item.isComponent)}} - {{#link-to 'docs.api.item' (concat 'modules/' item.id) class='hover:underline'}} + {{#link-to 'api.item' (concat 'modules/' item.id) class='hover:underline'}} {{item.name}} {{/link-to}} {{else}} diff --git a/addon/components/docs-header/component.js b/addon/components/docs-header/component.js index 1f018c029..7d9f25f25 100644 --- a/addon/components/docs-header/component.js +++ b/addon/components/docs-header/component.js @@ -35,6 +35,8 @@ export default Component.extend({ projectVersion: service(), + store: service(), + projectHref, latestVersionName, @@ -56,6 +58,10 @@ export default Component.extend({ currentVersion: reads('projectVersion.currentVersion'), + project: computed('store', function() { + return this.get('store').peekRecord('project', projectName); + }), + actions: { didVisitPage() { this.set('query', null); diff --git a/addon/components/docs-header/search-result/component.js b/addon/components/docs-header/search-result/component.js index 33f7a7d6f..734cbb06c 100644 --- a/addon/components/docs-header/search-result/component.js +++ b/addon/components/docs-header/search-result/component.js @@ -16,7 +16,7 @@ export default Component.extend({ args = [ this.get('result.document.route') ]; } else { - args = [ 'docs.api.item', this.get('result.model.routingId') ]; + args = [ 'api.item', this.get('result.model.routingId') ]; } return args; diff --git a/addon/components/docs-header/search-results/component.js b/addon/components/docs-header/search-results/component.js index feb86f69e..714ee811f 100644 --- a/addon/components/docs-header/search-results/component.js +++ b/addon/components/docs-header/search-results/component.js @@ -73,7 +73,7 @@ export default Component.extend(EKMixin, { // Filter out the templates of the API items' pages, since we handle them separately .filter(({ document }) => { - let isApiItemTemplate = (document.route === 'docs.api.item' && document.type === 'template'); + let isApiItemTemplate = (document.route === 'api.item' && document.type === 'template'); return !isApiItemTemplate; }) @@ -106,7 +106,7 @@ export default Component.extend(EKMixin, { if (selectedResult.document.type === 'template') { this.get('router').transitionTo(selectedResult.document.route); } else { - this.get('router').transitionTo('docs.api.item', selectedResult.model.get('routingId')); + this.get('router').transitionTo('api.item', selectedResult.model.get('routingId')); } } diff --git a/addon/components/docs-header/template.hbs b/addon/components/docs-header/template.hbs index 797f12c3c..fb32e2c05 100644 --- a/addon/components/docs-header/template.hbs +++ b/addon/components/docs-header/template.hbs @@ -16,6 +16,12 @@ Documentation {{/docs-header/link}} + {{#if (gt project.modules.length 0)}} + {{#docs-header/link 'api'}} + API Reference + {{/docs-header/link}} + {{/if}} + {{yield (hash link=(component 'docs-header/link') )}} diff --git a/addon/components/docs-viewer/x-main/component.js b/addon/components/docs-viewer/x-main/component.js index f682039b3..06ac18d35 100644 --- a/addon/components/docs-viewer/x-main/component.js +++ b/addon/components/docs-viewer/x-main/component.js @@ -72,7 +72,7 @@ export default Component.extend({ path = path.replace(/\./g, '/'); if (path === 'docs/api/item') { - let { path } = getOwner(this).lookup('route:application').paramsFor('docs.api.item'); + let { path } = getOwner(this).lookup('route:application').paramsFor('api.item'); let file = addonFiles.find(f => f.match(path)); if (file) { diff --git a/addon/components/docs-viewer/x-nav/component.js b/addon/components/docs-viewer/x-nav/component.js index 92afe303f..da079eab3 100644 --- a/addon/components/docs-viewer/x-nav/component.js +++ b/addon/components/docs-viewer/x-nav/component.js @@ -12,7 +12,7 @@ export default Component.extend({ layout, tagName: '', - root: 'docs', + root: 'api', store: service(), diff --git a/addon/components/docs-viewer/x-nav/template.hbs b/addon/components/docs-viewer/x-nav/template.hbs index c61c6e006..4d72feb33 100644 --- a/addon/components/docs-viewer/x-nav/template.hbs +++ b/addon/components/docs-viewer/x-nav/template.hbs @@ -34,18 +34,6 @@ subnav=(component 'docs-viewer/x-nav-list' class='ml-4') )}} - {{!-- Autogenerated API docs --}} - {{#if (gt project.modules.length 0)}} - {{docs-viewer/x-section 'API Reference' style='large'}} - - {{#each-in project.navigationIndex as |type items|}} - {{docs-viewer/x-section type}} - - {{#each items as |item|}} - {{docs-viewer/x-nav-item (break-on item.name '/') (concat root '.api.item') item.path}} - {{/each}} - {{/each-in}} - {{/if}} {{/docs-viewer/x-nav-list}}