{{ $t('documentation.hero.title') }}
++ {{ $t('documentation.hero.copy') }} +
+Frameworks
+Loading index…
+{{ doc.title || doc.path }}
+Tutorials
+Loading index…
+diff --git a/src/lang/locales/en-US.json b/src/lang/locales/en-US.json
index 04f995b89..d43ffb55d 100644
--- a/src/lang/locales/en-US.json
+++ b/src/lang/locales/en-US.json
@@ -69,7 +69,11 @@
"view-symbol": "View symbol",
"view-sample-code": "View sample code"
},
- "view-more": "View more"
+ "view-more": "View more",
+ "hero": {
+ "title": "Developer Documentation",
+ "copy": "Browse the latest API reference."
+ }
},
"declarations": {
"hide-other-declarations": "Hide other declarations",
diff --git a/src/lang/locales/ja-JP.json b/src/lang/locales/ja-JP.json
index 280bffe1d..b24244253 100644
--- a/src/lang/locales/ja-JP.json
+++ b/src/lang/locales/ja-JP.json
@@ -69,7 +69,11 @@
"view-symbol": "記号を表示",
"view-sample-code": "サンプルコードを表示"
},
- "view-more": "さらに表示"
+ "view-more": "さらに表示",
+ "hero": {
+ "title": "デベロッパドキュメント",
+ "copy": "最新のAPIリファレンスを閲覧できます。"
+ }
},
"declarations": {
"hide-other-declarations": "ほかの宣言を非表示",
diff --git a/src/lang/locales/ko-KR.json b/src/lang/locales/ko-KR.json
index 68b1afe7c..7dad7ec32 100644
--- a/src/lang/locales/ko-KR.json
+++ b/src/lang/locales/ko-KR.json
@@ -69,7 +69,11 @@
"view-symbol": "기호 보기",
"view-sample-code": "샘플 코드 보기"
},
- "view-more": "더 보기"
+ "view-more": "더 보기",
+ "hero": {
+ "title": "개발자 문서",
+ "copy": "최신 API 레퍼런스를 확인하세요."
+ }
},
"declarations": {
"hide-other-declarations": "다른 선언 가리기",
diff --git a/src/lang/locales/zh-CN.json b/src/lang/locales/zh-CN.json
index 5b779adf1..70236c2de 100644
--- a/src/lang/locales/zh-CN.json
+++ b/src/lang/locales/zh-CN.json
@@ -69,7 +69,11 @@
"view-symbol": "查看符号",
"view-sample-code": "查看示例代码"
},
- "view-more": "查看更多"
+ "view-more": "查看更多",
+ "hero": {
+ "title": "开发者文档",
+ "copy": "浏览最新的 API 参考。"
+ }
},
"declarations": {
"hide-other-declarations": "隐藏其他声明",
diff --git a/src/mixins/indexDataFetcher.js b/src/mixins/indexDataFetcher.js
index 10d41881d..2940a80df 100644
--- a/src/mixins/indexDataFetcher.js
+++ b/src/mixins/indexDataFetcher.js
@@ -28,8 +28,10 @@ export default {
interfaceLanguages,
references = {},
} = await fetchData(this.indexDataPath);
+ const topLevelNodes = Object.values(interfaceLanguages || {}).flat();
const flatChildren = Object.freeze(flattenNavigationIndex(interfaceLanguages));
IndexStore.setFlatChildren(flatChildren);
+ IndexStore.setTopLevelNodes(topLevelNodes);
IndexStore.setTechnologyProps(extractTechnologyProps(interfaceLanguages));
IndexStore.setReferences(references);
IndexStore.setIncludedArchiveIdentifiers(includedArchiveIdentifiers);
diff --git a/src/routes.js b/src/routes.js
index 11343bed5..d916fa49e 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -16,6 +16,14 @@ import {
import ServerError from 'theme/views/ServerError.vue';
import NotFound from 'theme/views/NotFound.vue';
+export const homeRoute = {
+ path: '/',
+ name: 'home-index',
+ component: () => import(
+ /* webpackChunkName: "home-index" */ 'theme/views/Index.vue'
+ ),
+};
+
export const fallbackRoutes = [
{
path: '*',
@@ -54,6 +62,7 @@ export const pagesRoutes = [
];
export default [
+ homeRoute,
...pagesRoutes,
...fallbackRoutes,
];
diff --git a/src/setup-utils/SwiftDocCRenderRouter.js b/src/setup-utils/SwiftDocCRenderRouter.js
index 26a70308d..8558a9b89 100644
--- a/src/setup-utils/SwiftDocCRenderRouter.js
+++ b/src/setup-utils/SwiftDocCRenderRouter.js
@@ -14,12 +14,13 @@ import {
restoreScrollOnReload,
scrollBehavior,
} from 'docc-render/utils/router-utils';
-import routes, { fallbackRoutes } from 'docc-render/routes';
+import { homeRoute, pagesRoutes, fallbackRoutes } from 'docc-render/routes';
import { baseUrl } from 'docc-render/utils/theme-settings';
import { addPrefixedRoutes } from 'docc-render/utils/route-utils';
const defaultRoutes = [
- ...addPrefixedRoutes(routes),
+ homeRoute,
+ ...addPrefixedRoutes(pagesRoutes),
...fallbackRoutes,
];
diff --git a/src/stores/IndexStore.js b/src/stores/IndexStore.js
index 39333424f..600f5b290 100644
--- a/src/stores/IndexStore.js
+++ b/src/stores/IndexStore.js
@@ -11,6 +11,7 @@
export default {
state: {
flatChildren: null,
+ topLevelNodes: [],
references: {},
apiChanges: null,
apiChangesVersion: null,
@@ -21,6 +22,7 @@ export default {
},
reset() {
this.state.flatChildren = null;
+ this.state.topLevelNodes = [];
this.state.references = {};
this.state.apiChanges = null;
this.state.apiChangesVersion = null;
@@ -35,6 +37,9 @@ export default {
setReferences(references) {
this.state.references = references;
},
+ setTopLevelNodes(nodes) {
+ this.state.topLevelNodes = nodes || [];
+ },
setApiChanges(diff) {
this.state.apiChanges = diff;
},
diff --git a/src/views/Index.vue b/src/views/Index.vue
new file mode 100644
index 000000000..85a12288b
--- /dev/null
+++ b/src/views/Index.vue
@@ -0,0 +1,315 @@
+
+
+
+
+ {{ $t('documentation.hero.copy') }}
+ Loading index… Loading index…{{ $t('documentation.title') || 'Documentation' }}
+
+
+
+ {{ $t('documentation.hero.title') }}
+ Frameworks
+ {{ doc.title || doc.path }}
+ Tutorials
+ {{ tutorial.title || tutorial.path }}
+