diff --git a/src/.vuepress/client.ts b/src/.vuepress/client.ts index 7464fa713..2cac38fff 100644 --- a/src/.vuepress/client.ts +++ b/src/.vuepress/client.ts @@ -18,6 +18,7 @@ import { defineDocSearchConfig } from '@vuepress/plugin-docsearch/client'; import { computed } from 'vue'; +import { useRouter, withBase } from 'vuepress/client'; import { defineClientConfig, usePageData } from 'vuepress/client'; import DocSearch from './components/DocSearch.vue'; import { getDocVersion } from './utils/index.js'; @@ -28,6 +29,19 @@ export default defineClientConfig({ }, setup() { const pageData = usePageData(); + const router = useRouter(); + + let lastTo = ''; + + router.onError((error) => { + console.warn(error); + if(!lastTo) return; + window.location.href = withBase(lastTo); + lastTo = ''; + }); + router.beforeEach((to) => { + lastTo = to.fullPath; + }); const docSearchConfig = computed(() => ({ appId: 'JLT9R2YGAE', diff --git a/src/.vuepress/styles/index.scss b/src/.vuepress/styles/index.scss index 072e55dce..e36ad3a3a 100644 --- a/src/.vuepress/styles/index.scss +++ b/src/.vuepress/styles/index.scss @@ -16,6 +16,12 @@ * limitations under the License. */ +// #main-description { +// max-width: 55rem; +// } +.vp-skip-link { + z-index: 1; +} .vp-hero-image { max-width: 420px; } @@ -82,3 +88,17 @@ footer { div[class*='language-'] pre code { color: var(--code-c-text); } + +.home { + .theme-hope-content { + inset: 0; + z-index: 0; + position: relative; + background-attachment: fixed; + background-position: 50%; + background-size: cover; + max-width: 100%; + padding: 0; + display: inline; + } +} \ No newline at end of file