diff --git a/Dockerfile b/Dockerfile
index 2e35efd912ea1349aa295b2d3893885356d78355..8d2e47e0722dd2938b789de7e9ea572f2e408509 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:18.14.1 as Builder
+FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/node:latest as Builder
RUN mkdir -p /home/openeuler/docs
WORKDIR /home/openeuler/docs
@@ -8,9 +8,9 @@ RUN npm install pnpm -g
RUN pnpm install
RUN pnpm build
-FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder
+FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:latest as NginxBuilder
-FROM openeuler/openeuler:22.03
+FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/base:latest
ENV NGINX_CONFIG_FILE /etc/nginx/nginx.conf
ENV NGINX_CONFIG_PATH /etc/nginx/
diff --git a/docs/.vitepress/src/App.vue b/docs/.vitepress/src/App.vue
index 4df67b71db905105cf34ff1c9adcb878eed1543e..94e7b82165c0df1b2430c759ff425977ba51fb0a 100644
--- a/docs/.vitepress/src/App.vue
+++ b/docs/.vitepress/src/App.vue
@@ -1,41 +1,34 @@
diff --git a/docs/.vitepress/src/composables/useLocation.ts b/docs/.vitepress/src/composables/useLocation.ts
deleted file mode 100644
index 8d3e66a672a032bf5d3e2942afd1661908b90cdc..0000000000000000000000000000000000000000
--- a/docs/.vitepress/src/composables/useLocation.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { computed, onMounted, onUnmounted, readonly, ref } from 'vue';
-import { useRouter } from 'vitepress';
-import { isClient } from '@opensig/opendesign';
-
-export const useLocation = () => {
- const router = useRouter();
- const href = ref(isClient ? window.location.href : '');
- const hash = ref(isClient ? window.location.hash : '');
-
- const pathname = computed(() => router.route.path);
- const url = computed(() => {
- return isClient ? href.value.replace(window.location.origin, '') : '';
- });
-
- const hashchange = () => {
- href.value = window.location.href || '';
- hash.value = window.location.hash || '';
- };
-
- onMounted(() => {
- window.addEventListener('hashchange', hashchange);
- })
-
- onUnmounted(() => {
- window.removeEventListener('hashchange', hashchange);
- })
-
-
- router.onAfterRouteChanged = () => {
- hash.value = window.location.hash || '';
- href.value = window.location.href || '';
- };
-
- return {
- href: readonly(href),
- hash: readonly(hash),
- pathname,
- url,
- };
-}
diff --git a/docs/.vitepress/src/composables/useVisibleHeight.ts b/docs/.vitepress/src/composables/useVisibleHeight.ts
deleted file mode 100644
index 0fa31e803f461d299c2331baf2463b6a4885ce21..0000000000000000000000000000000000000000
--- a/docs/.vitepress/src/composables/useVisibleHeight.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { isClient } from "@opensig/opendesign";
-import { onMounted, onUnmounted, readonly, ref } from "vue";
-
-export const useVisibleHeight = (parentSelector: string, childSelector: string) => {
- const height = ref(0);
- let observer: IntersectionObserver | null;
-
- if (isClient) {
- observer = new IntersectionObserver(
- (entries) => {
- entries.forEach((entry) => {
- if (entry.isIntersecting) {
- const parent = document.querySelector(parentSelector);
- const child = document.querySelector(childSelector);
- if (parent && child) {
- const parentRect = parent.getBoundingClientRect();
- const childRect = child.getBoundingClientRect();
- const visibleTop = Math.max(0, childRect.top - parentRect.top);
- const visibleBottom = Math.min(parentRect.bottom, childRect.bottom) - parentRect.top;
- const visibleHeight = visibleBottom - visibleTop;
- height.value = visibleHeight > 0 ? visibleHeight : 0;
- }
- } else {
- height.value = 0;
- }
- });
- },
- {
- threshold: Array.from({ length: 90 }, (_, i) => (i + 10) / 100),
- }
- );
- }
-
- onMounted(() => {
- const footer = document.querySelector('.ly-footer');
- if (footer) {
- observer?.observe(footer);
- }
- });
-
- onUnmounted(() => {
- const footer = document.querySelector('.ly-footer');
- if (footer) {
- observer?.unobserve(footer);
- }
-
- observer = null;
- });
-
- return readonly(height);
-};
\ No newline at end of file
diff --git a/docs/.vitepress/src/layouts/LayoutDoc.vue b/docs/.vitepress/src/layouts/LayoutDoc.vue
index b78ba45c66d421a11efc0a7172c59e58434bc1c3..d6d9ac76fee98b44cceaa356db8803848f3e9e12 100644
--- a/docs/.vitepress/src/layouts/LayoutDoc.vue
+++ b/docs/.vitepress/src/layouts/LayoutDoc.vue
@@ -1,7 +1,7 @@
@@ -609,7 +565,7 @@ onUpdated(() => {
align-items: center;
color: var(--o-color-link1);
text-decoration: none !important;
-
+
svg {
color: var(--o-color-link1);
width: 16px;
diff --git a/docs/.vitepress/src/stores/menu.ts b/docs/.vitepress/src/stores/menu.ts
index df277dd7b3d3484a8e1844603c4d3eb8af5488d3..66223d71f6f8a4e4a979bff008e6f83355840950 100644
--- a/docs/.vitepress/src/stores/menu.ts
+++ b/docs/.vitepress/src/stores/menu.ts
@@ -2,20 +2,27 @@ import { computed, onMounted, ref, watch } from 'vue';
import { defineStore } from 'pinia';
import { MENU_CONFIG } from '@/config/menu';
import { DocMenuTree, type DocMenuNodeT } from '@/utils/tree';
-import { useLocation } from '@/composables/useLocation';
+import { useData } from 'vitepress';
export const useMenuStore = defineStore('menu', () => {
const rootTree = new DocMenuTree(MENU_CONFIG);
const allNodes = rootTree.root.children;
- const { url, hash } = useLocation();
+ const { hash, page } = useData();
// -------------------- 当前菜单节点 --------------------
const currentNode = computed(() => {
- const href = url.value.split('#')[0];
- const node = rootTree.getNodeByHref(rootTree.root, decodeURIComponent(url.value));
- const anchorNode = rootTree.getNodeByHref(rootTree.root, decodeURIComponent(href));
- const indexNode = rootTree.getNodeByHref(rootTree.root, decodeURIComponent(href) + 'index.html');
- return node || anchorNode || indexNode;
+ const href = `/${page.value.filePath.replace('.md', '.html')}`;
+
+ // 是否为hash节点
+ if (hash.value) {
+ const hashHref = `/${page.value.filePath.replace('.md', '.html')}${decodeURIComponent(hash.value)}`;
+ const hashNode = rootTree.getNodeByHref(rootTree.root, hashHref);
+ if (hashNode) {
+ return hashNode;
+ }
+ }
+
+ return rootTree.getNodeByHref(rootTree.root, href);
});
// -------------------- 当前菜单节点的所有前驱节点 --------------------
@@ -71,8 +78,6 @@ export const useMenuStore = defineStore('menu', () => {
});
return {
- url,
- hash,
menuValue, // 绑定菜单值
menuExpanded, // 展开值
rootTree, // 根节点