From fe6f5376a91af47833fd225053f95ae8ad1c5bf1 Mon Sep 17 00:00:00 2001 From: Justineo Date: Mon, 19 Jul 2021 16:27:38 +0800 Subject: [PATCH] feat: upgrade sidebar, remove header, upgrade search --- assets/styles/global.styl | 2 +- common/i18n.js | 9 +- components/OneHeader.vue | 89 ----- components/OneMenu.vue | 282 +++++--------- components/OneSearch.vue | 107 ++++++ layouts/default.vue | 9 +- nuxt.config.js | 18 +- one/build/rehype-link.js | 12 +- one/docs/en-US/index.md | 2 +- one/docs/index.md | 2 +- package-lock.json | 776 +++++++++++++++++++++++++------------- package.json | 14 +- plugins/algolia.js | 32 -- plugins/config.js | 4 - 14 files changed, 726 insertions(+), 632 deletions(-) delete mode 100644 components/OneHeader.vue create mode 100644 components/OneSearch.vue delete mode 100644 plugins/algolia.js delete mode 100644 plugins/config.js diff --git a/assets/styles/global.styl b/assets/styles/global.styl index fe59464..ee43b89 100644 --- a/assets/styles/global.styl +++ b/assets/styles/global.styl @@ -23,7 +23,7 @@ body height 100% body - margin-left 240px + margin-left 280px button input diff --git a/common/i18n.js b/common/i18n.js index 143ea28..edeabc1 100644 --- a/common/i18n.js +++ b/common/i18n.js @@ -74,14 +74,13 @@ export default { } }, methods: { - getLocalePath (path, locale) { - let loc = locale || this.locale - if (loc === DEFAULT_LOCALE) { + getLocalePath (path, locale = this.locale) { + if (locale === DEFAULT_LOCALE) { return path } - return `/${loc}${path}`.replace(/\/$/, '') + return `/${locale}${path}`.replace(/\/$/, '') }, - isPathDisabled (path, locale) { + isPathDisabled (path, locale = this.locale) { let segments = compact(path.split('/')) let navItem = segments.reduce((node, seg) => { if (!node) { diff --git a/components/OneHeader.vue b/components/OneHeader.vue deleted file mode 100644 index 2e9373b..0000000 --- a/components/OneHeader.vue +++ /dev/null @@ -1,89 +0,0 @@ - - - - - diff --git a/components/OneMenu.vue b/components/OneMenu.vue index 5941931..944aed3 100644 --- a/components/OneMenu.vue +++ b/components/OneMenu.vue @@ -1,90 +1,53 @@ diff --git a/layouts/default.vue b/layouts/default.vue index 0412227..ce7a1fa 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -5,7 +5,6 @@ 'no-links': !hasFooterLinks }" > - import 'focus-visible' -import OneHeader from '../components/OneHeader' import OneMenu from '../components/OneMenu' import OneFooter from '../components/OneFooter' import OneBackToTop from '../components/OneBackToTop' @@ -30,7 +28,6 @@ import i18nMgr from 'veui/managers/i18n' export default { name: 'main-doc', components: { - OneHeader, OneMenu, OneFooter, OneBackToTop @@ -81,15 +78,13 @@ export default {