diff --git a/.gitignore b/.gitignore index e59aab703a92d32828b3ebe639adb3ac5177a6e3..bcd3a5dd60c795fbcaaa31ed12fdbb953a953210 100644 --- a/.gitignore +++ b/.gitignore @@ -118,12 +118,16 @@ dist # mac .DS_Store +# Hugo build output +/public +/content +.hugo_build.lock + +# Repo cache temp-docs .cache -app/zh/docs/**/* -app/en/docs/**/* - +# Project build output app/.vitepress/.temp app/.vitepress/.cache app/.vitepress/dist @@ -132,4 +136,9 @@ app/.vitepress/public/menu/**/* app/.vitepress/public/toc/**/* app/.vitepress/public/dsl/**/* +# Project docs +app/zh/docs/**/* +app/en/docs/**/* + +# Project env .env.development diff --git a/README.en.md b/README.en.md index 192626704bededae1fe6846ad3516d56c22b84be..f4ed676cef3df9bc9bf055340da7cea4ce553ac4 100644 --- a/README.en.md +++ b/README.en.md @@ -25,12 +25,3 @@ Software architecture description 3. Commit your code 4. Create Pull Request - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/app/.vitepress/src/api/api-message.ts b/app/.vitepress/src/api/api-message.ts index 0a7146b7394e7a884f68d5ee8d3d36e760657664..5f7a3d66bfa569147a77953fe0d3e46a407433e7 100644 --- a/app/.vitepress/src/api/api-message.ts +++ b/app/.vitepress/src/api/api-message.ts @@ -3,10 +3,9 @@ import { request } from '@/shared/axios'; /** * 获取消息中心未读消息数量 */ -export function getUnreadMsgCount(giteeLoginName?: string) { +export function getUnreadMsgCount() { return request .get<{ count: Record }>('/api-message/inner/count_new', { - params: { gitee_user_name: giteeLoginName }, showError: false, }) .then((res) => res.data.count); diff --git a/app/.vitepress/src/components/doc/DocBugDialog.vue b/app/.vitepress/src/components/doc/DocBugDialog.vue index fb507e2682ddc9b8f1a05f38cbd3e746121cc382..73608db57a6697808b48737f2ca986f4c3923bd9 100644 --- a/app/.vitepress/src/components/doc/DocBugDialog.vue +++ b/app/.vitepress/src/components/doc/DocBugDialog.vue @@ -148,19 +148,19 @@ const issueTemplate = (data: DocsBugParamsT) => { return `1. 【文档链接】 - > ${data.link} - - 2. 【"有虫"文档片段】 - - > ${data.bugDocFragment.replace(/(\r\n|\r|\n)+/g, '$1')} - - 3. 【存在的问题】 - - ${problem} - > ${data.problemDetail.replace(/(\r\n|\r|\n)+/g, '$1')} - - 4. 【预期结果】 - - 请填写预期结果`; +> ${data.link} + +2. 【"有虫"文档片段】 + +> ${data.bugDocFragment.replace(/(\r\n|\r|\n)+/g, '$1')} + +3. 【存在的问题】 + +${problem} +> ${data.problemDetail.replace(/(\r\n|\r|\n)+/g, '$1')} + +4. 【预期结果】 +- 请填写预期结果`; }; const submitBug = (results: FieldResultT[]) => { @@ -184,8 +184,8 @@ const submitBug = (results: FieldResultT[]) => { if (res.code === 200) { emit('update:modelValue', false); if (submitType.value === 'issue') { - const issueBaseUrl = nodeStore.pageNode?.upstream ? nodeStore.pageNode.upstream.split('/blob')[0] : 'https://gitee.com/openeuler/docs'; - window.open(`${issueBaseUrl}/issues/new?issue%5Bassignee_id%5D=0&issue%5Bmilestone_id%5D=0&title=文档捉虫&description=${body}`); + const issueBaseUrl = nodeStore.pageNode?.upstream ? nodeStore.pageNode.upstream.split('/blob')[0] : 'https://atomgit.com/openeuler/docs'; + window.open(`${issueBaseUrl}/issues/new?title=文档捉虫&body=${body}`); } else { let pathname = window.location.pathname; if (pathname.endsWith('.html')) { @@ -199,12 +199,12 @@ const submitBug = (results: FieldResultT[]) => { const [_, lang, __, branch, ...others] = pathname.split('/'); if (viewStore.isOverview && nodeStore.pageNode?.href) { const arr = nodeStore.pageNode.href.replace('index.html', '_toc.yaml').split('/'); - window.open(`https://gitee.com/-/ide/project/openeuler/docs/edit/stable-${arr[3]}/-/docs/${lang}/${arr.slice(4).join('/')}?search=${first}&title=文档捉虫-openEuler ${branch}-${page.value.title}&description=${formData.description}&message=${formData.description}&label_names=文档捉虫`); + window.open(`https://atomgit.com/openeuler/docs/edit/stable-${arr[3]}/docs/${lang}/${arr.slice(4).join('/')}?search=${first}&title=文档捉虫-openEuler ${branch}-${page.value.title}&description=${formData.description}&message=${formData.description}&label_names=文档捉虫`); } else if (nodeStore.pageNode?.upstream) { const arr = nodeStore.pageNode.upstream.split('/'); - window.open(`https://gitee.com/-/ide/project/${arr[3]}/${arr[4]}/edit/${arr[6]}/-/${arr.slice(7).join('/')}?search=${first}&title=文档捉虫-openEuler ${branch}-${page.value.title}&description=${formData.description}&message=${formData.description}&label_names=文档捉虫`); + window.open(`https://atomgit.com/${arr[3]}/${arr[4]}/edit/${arr[6]}/${arr.slice(7).join('/')}?search=${first}&title=文档捉虫-openEuler ${branch}-${page.value.title}&description=${formData.description}&message=${formData.description}&label_names=文档捉虫`); } else { - window.open(`https://gitee.com/-/ide/project/openeuler/docs/edit/stable-${branch}/-/docs/${lang}/${others.join('/')}?search=${first}&title=文档捉虫-openEuler ${branch}-${page.value.title}&description=${formData.description}&message=${formData.description}&label_names=文档捉虫`); + window.open(`https://atomgit.com/openeuler/docs/edit/stable-${branch}/docs/${lang}/${others.join('/')}?search=${first}&title=文档捉虫-openEuler ${branch}-${page.value.title}&description=${formData.description}&message=${formData.description}&label_names=文档捉虫`); } } diff --git a/app/.vitepress/src/components/GiteeViewSource.vue b/app/.vitepress/src/components/doc/DocViewSource.vue similarity index 83% rename from app/.vitepress/src/components/GiteeViewSource.vue rename to app/.vitepress/src/components/doc/DocViewSource.vue index 35bac28ccdbcfd32f31a075bdb2bde0f185b6130..d0734ca86a0e4f6e69bd771e592a4643bace1273 100644 --- a/app/.vitepress/src/components/GiteeViewSource.vue +++ b/app/.vitepress/src/components/doc/DocViewSource.vue @@ -6,7 +6,7 @@ import { isClient, OIcon } from '@opensig/opendesign'; import IconOutLink from '~icons/app/icon-outlink.svg'; -import { getGiteeUrl } from '@/utils/common'; +import { getSourceUrl } from '@/utils/common'; import { isOverlap } from '@/utils/element'; import { useScreen } from '@/composables/useScreen'; @@ -19,19 +19,19 @@ const { width } = useWindowSize(); const route = useRoute(); const nodeStore = useNodeStore(); -const giteeUrl = ref(''); +const sourceUrl = ref(''); watch( () => route.path, () => { if (isClient) { - giteeUrl.value = getGiteeUrl(nodeStore.pageNode); + sourceUrl.value = getSourceUrl(nodeStore.pageNode); } } ); onMounted(() => { - giteeUrl.value = getGiteeUrl(nodeStore.pageNode); + sourceUrl.value = getSourceUrl(nodeStore.pageNode); }); // -------------------- 检查标题和viewsource是否有重叠 -------------------- @@ -53,12 +53,12 @@ onMounted(() => { checkOverlap(); }); -// -------------------- 移动端插入gitee -------------------- -const insertGiteeBtn = () => { +// -------------------- 移动端插入查看源文件 -------------------- +const insertViewSourceBtn = () => { if (isPhone.value || overlap.value) { - const link = document.querySelector('.markdown-body .gitee') as HTMLAnchorElement; + const link = document.querySelector('.markdown-body .git') as HTMLAnchorElement; if (link) { - link.href = getGiteeUrl(nodeStore.pageNode); + link.href = getSourceUrl(nodeStore.pageNode); return; } @@ -68,10 +68,10 @@ const insertGiteeBtn = () => { const container = document.createElement('div'); container.className = 'article-detail-container'; const a = document.createElement('a'); - a.className = 'gitee'; - a.href = getGiteeUrl(nodeStore.pageNode); + a.className = 'git'; + a.href = getSourceUrl(nodeStore.pageNode); a.target = '_blank'; - a.textContent = t('docs.viewGiteeSource') || ''; + a.textContent = t('docs.viewSource') || ''; const svgString = ` @@ -86,7 +86,7 @@ const insertGiteeBtn = () => { titleDom.nextSibling.parentNode?.insertBefore(container, titleDom.nextSibling); } } else { - const link = document.querySelector('.markdown-body .gitee') as HTMLAnchorElement; + const link = document.querySelector('.markdown-body .git') as HTMLAnchorElement; if (link) { link.remove(); } @@ -96,14 +96,14 @@ const insertGiteeBtn = () => { watch([isPhone, width, route], async () => { await nextTick(); checkOverlap(); - insertGiteeBtn(); + insertViewSourceBtn(); });
- - {{ t('docs.viewGiteeSource') }} + @@ -114,7 +114,7 @@ watch([isPhone, width, route], async () => { margin-top: var(--o-gap-2); margin-bottom: var(--o-gap-6); - .gitee { + .git { display: flex; align-items: center; color: var(--o-color-link1); @@ -130,7 +130,7 @@ watch([isPhone, width, route], async () => {