Skip to content

Commit

Permalink
fix: versions
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangAhua committed Sep 7, 2023
1 parent 58d792c commit 758e89c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 43 deletions.
7 changes: 4 additions & 3 deletions src/components/SelectNav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import versionsList from '@site/versions.json'
export default function SelectNav({ label, items }) {
let history = useHistory();
let pathname = useLocation().pathname;
let cur = pathname.replace('/docs/', '').split('/')[0]
let dongtai = pathname.startsWith('/doc/')
let cur = pathname.replace(dongtai ? '/doc/docs/' : '/docs/', '').split('/')[0]
let flag = cur === 'next' || versionsList.includes(cur)
let pagePath = flag ? pathname.replace(`/docs/${cur}`, '') : pathname.replace('/docs', '')
// console.log('----', pathname.replace('/docs/', '').split('/')[0], flag, pagePath)
let pagePath = flag ? pathname.replace(dongtai ? `/doc/docs/${cur}` : `/docs/${cur}`, '') : pathname.replace(dongtai ? '/doc/docs' : '/docs', '')
console.log('----', pathname, pagePath)
const [selectedOption, setSelectedOption] = flag ? useState(cur === 'next' ? 'Next' : cur) : useState(items[1].label);
const [showDropdown, setShowDropdown] = useState(false);

Expand Down
49 changes: 9 additions & 40 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,61 +20,37 @@ const features = [
title: '快速开始',
imageUrl: 'img/index/getting-started.svg',
url:'docs/category/快速开始',
description: (
<>
快速部署洞态,开始您的互动式安全检测项目
</>
),
description: '快速部署洞态,开始您的互动式安全检测项目',
},
{
title: '用户案例',
imageUrl: 'img/index/operation.svg',
url:'docs/user-case',
description: (
<>
介绍洞态的用户案例
</>
),
description: '介绍洞态的用户案例',
},
{
title: '最佳实践',
imageUrl: 'img/index/star.svg',
url:'docs/best-practice-case',
description: (
<>
洞态在 DevSecOps 中的最佳实践
</>
),
description: '洞态在 DevSecOps 中的最佳实践',
},
{
title: 'API',
imageUrl: 'img/index/api.svg',
url:'docs/api/openapi/openapi-agent-develop',
description: (
<>
洞态api的使用简介
</>
),
url:'docs/api/openapi/openapi-agent-develop/',
description: '洞态api的使用简介',
},
{
title: '开发者文档',
imageUrl: 'img/index/wendang.svg',
url:'docs/development/dongtai-java-agent-doc/',
description: (
<>
这是 Dongtai-Java-Agent 的官方文档,在这里你将了解到关于 Dongtai-Java-Agent 的相关介绍
</>
),
description: '这是 Dongtai-Java-Agent 的官方文档,在这里你将了解到关于 Dongtai-Java-Agent 的相关介绍',
},
{
title: '更新日志',
imageUrl: 'img/index/rizhi.svg',
url:'docs/changelog/release-note',
description: (
<>
洞态发版通知
</>
),
description: '洞态发版通知'
},
];

Expand All @@ -92,10 +68,7 @@ const features2 = [
{label:"📙 洞态漏洞检测相关问题",url:"docs/get-help/faq-detect"},
{label:"📙 联系我们",url:"docs/get-help/contact-us"},
],
description: (
<>
</>
),
description: '',
},

{
Expand All @@ -105,11 +78,7 @@ const features2 = [
links:[
{label:"Java-Sec-code靶场测试报告",url:"https://i0x0fy4ibf.feishu.cn/docx/Vrs1d5emZoNQkNxO0Evc13htnIk"},
],
description: (
<>

</>
),
description: '',

},
];
Expand Down

0 comments on commit 758e89c

Please sign in to comment.