From 195a6916396d04771a0d4d03e3cbeac6c1604d25 Mon Sep 17 00:00:00 2001 From: Holger Huo <50446405+HolgerHuo@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:37:19 +0800 Subject: [PATCH] feat: courses section --- .github/workflows/upload_artifact.yaml | 2 +- .vitepress/config.mts | 43 +++++++++++-------- .../ics.md => courses/ics/getting-started.md | 2 +- courses/index.md | 8 ++++ contributors.md => docs/contributors.md | 0 faq.md => docs/faq.md | 0 .../getting-started}/introduction.md | 8 ++-- .../getting-started}/lcpu-mirror.md | 0 docs/index.md | 4 ++ .../networking}/private-network.md | 0 .../networking}/router-and-floating-ip.md | 0 .../networking}/security-group.md | 0 {storage => docs/storage}/advanced.md | 0 .../storage}/volume-snapshots-and-backups.md | 0 {storage => docs/storage}/volume-type.md | 0 15 files changed, 43 insertions(+), 24 deletions(-) rename course/ics.md => courses/ics/getting-started.md (93%) create mode 100644 courses/index.md rename contributors.md => docs/contributors.md (100%) rename faq.md => docs/faq.md (100%) rename {getting-started => docs/getting-started}/introduction.md (96%) rename {getting-started => docs/getting-started}/lcpu-mirror.md (100%) create mode 100644 docs/index.md rename {networking => docs/networking}/private-network.md (100%) rename {networking => docs/networking}/router-and-floating-ip.md (100%) rename {networking => docs/networking}/security-group.md (100%) rename {storage => docs/storage}/advanced.md (100%) rename {storage => docs/storage}/volume-snapshots-and-backups.md (100%) rename {storage => docs/storage}/volume-type.md (100%) diff --git a/.github/workflows/upload_artifact.yaml b/.github/workflows/upload_artifact.yaml index 087ddc0..f8ae720 100644 --- a/.github/workflows/upload_artifact.yaml +++ b/.github/workflows/upload_artifact.yaml @@ -36,7 +36,7 @@ jobs: - name: Upload Tarball uses: fjogeleit/http-request-action@v1 with: - url: 'https://jfrog.lcpu.dev/artifactory/cloud-doc/latest.tar.gz' + url: 'https://jfrog.lcpu.dev/artifactory/cloud-doc/latest-neo.tar.gz' method: 'PUT' bearerToken: ${{ secrets.JFROG_BEARER_TOKEN }} file: ${{ github.workspace }}/.vitepress/clab-docs.tar.gz diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 8f62890..d7a0445 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -6,7 +6,7 @@ export default defineConfig({ description: "开箱即用的免费云计算服务,为教学与科研服务。", head: [['link', { rel: 'icon', href: '/favicon.ico' }]], lastUpdated: true, - base: '/docs', + base: '/', cleanUrls: true, srcExclude: [ 'README.md' ], themeConfig: { @@ -15,34 +15,41 @@ export default defineConfig({ logoLink: '/docs/getting-started/introduction', nav: [ { text: 'PKU Clab', link: 'https://clab.pku.edu.cn', target: '_self'}, - { text: '文档', link: '/getting-started/introduction', activeMatch: '/' }, - + { text: '文档', link: '/docs/getting-started/introduction', activeMatch: '/docs' }, + { text: '课程专区', link: '/courses', activeMatch: '/courses' }, ], sidebar: { - '/': [ + '/courses': [ { - text: '文档', + text: '课程专区', items: [ - { text: '快速开始', link: '/getting-started/introduction' }, - { text: '课程专区', items: [ - { text: "ICS", link: '/course/ics'} + { text: 'ICS', items: [ + { text: "快速开始", link: '/courses/ics/getting-started'} ] - }, + } + ] + } + ], + '/docs/': [ + { + text: '文档', + items: [ + { text: '快速开始', link: '/docs/getting-started/introduction' }, { text: '网络', items: [ - { text: "自组网", link: '/networking/private-network'}, - { text: "Router和浮动IP", link: '/networking/router-and-floating-ip'}, - { text: "安全组", link: '/networking/security-group'} + { text: "自组网", link: '/docs/networking/private-network'}, + { text: "Router和浮动IP", link: '/docs/networking/router-and-floating-ip'}, + { text: "安全组", link: '/docs/networking/security-group'} ] }, { text: '储存', items: [ - { text: "Volume类型", link: '/storage/volume-type'}, - { text: "Volume快照和备份", link: '/storage/volume-snapshots-and-backups'}, - { text: "高级功能", link: '/storage/advanced'} + { text: "Volume类型", link: '/docs/storage/volume-type'}, + { text: "Volume快照和备份", link: '/docs/storage/volume-snapshots-and-backups'}, + { text: "高级功能", link: '/docs/storage/advanced'} ] }, - { text: '镜像站使用指南', link: '/getting-started/lcpu-mirror' }, - { text: 'FAQ', link: '/faq' }, - { text: '贡献者与致谢', link: '/contributors' } + { text: '镜像站使用指南', link: '/docs/getting-started/lcpu-mirror' }, + { text: 'FAQ', link: '/docs/faq' }, + { text: '贡献者与致谢', link: '/docs/contributors' } ] } ], diff --git a/course/ics.md b/courses/ics/getting-started.md similarity index 93% rename from course/ics.md rename to courses/ics/getting-started.md index 8c10cfc..5ac6bcc 100644 --- a/course/ics.md +++ b/courses/ics/getting-started.md @@ -6,7 +6,7 @@ title: ICS 课程实验环境 ICS 课程使用 CLab 作为实验环境。理论上所有 Lab 都需要在使用 CLab 平台完成。不过带有硬性限制的只有`attack lab`, `bomb lab` 和 `proxy lab`。 -建议阅读[快速上手](/getting-started/introduction),以了解云平台的使用。阅读完快速上手后,可以对照以下的建议创建虚拟机。 +建议阅读[快速上手](/docs/getting-started/introduction),以了解云平台的使用。阅读完快速上手后,可以对照以下的建议创建虚拟机。 # 虚拟机配置 diff --git a/courses/index.md b/courses/index.md new file mode 100644 index 0000000..2033950 --- /dev/null +++ b/courses/index.md @@ -0,0 +1,8 @@ +--- +title: 课程专区 +next: false +prev: false +--- + +CLab作为服务北大师生的云计算平台,目前已经开通如下课程的专属支持,可在以下页面查看课程专属文档。 +- [计算机系统导论](/courses/ics/getting-started) \ No newline at end of file diff --git a/contributors.md b/docs/contributors.md similarity index 100% rename from contributors.md rename to docs/contributors.md diff --git a/faq.md b/docs/faq.md similarity index 100% rename from faq.md rename to docs/faq.md diff --git a/getting-started/introduction.md b/docs/getting-started/introduction.md similarity index 96% rename from getting-started/introduction.md rename to docs/getting-started/introduction.md index a054785..29bd8b5 100644 --- a/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -61,7 +61,7 @@ CPU 核数和内存大小是用来区分不同规格的云主机的,每位同 - 镜像:使用一个镜像启动云主机,镜像是一个预先配置好的系统,没有任何数据 - 云主机镜像:是一个云主机的快照,包含了云主机的所有数据,主要用途是避免重复配置 -- 云硬盘:是一个云硬盘,可以在不同同学之间传输。如果需要用到这部分,请参考[储存:高级功能](/storage/advanced) +- 云硬盘:是一个云硬盘,可以在不同同学之间传输。如果需要用到这部分,请参考[储存:高级功能](/docs/storage/advanced) 我们一般选择镜像启动。云为大家提供了一些常用的镜像,比如 RockyLinux, Debian, Ubuntu, Arch Linux 等。选择一个镜像后,可以选择镜像的版本,比如 RockyLinux 9, Ubuntu 22.04 等。 我们定期测试并维护 RockyLinux, Debian, Ubuntu 和 Arch Linux 的镜像和常见问题文档,推荐使用这些镜像。 @@ -82,7 +82,7 @@ CLab 提供两种硬盘类型,分别是 SSD 和 HDD。SSD 是固态硬盘阵 首先是选择需要加载的网络。网络分为两种: - 共享网络:大家可以在这里看到一个名为“PKU”的网络,这是校园网。选择这个网络,云主机就直接被校园网访问,在云主机上登陆网关之后就可以访问互联网。校园网的带宽限制为 200 Mbps -- 当前项目网络:大家可以创建当前项目使用的网络,可以用来在云主机之间高速互联。自组网的带宽为 10Gbps 。详细可以参考[网络:自组网](/networking/private-network)。对于大部分同学来说,不需要选择这个网络。 +- 当前项目网络:大家可以创建当前项目使用的网络,可以用来在云主机之间高速互联。自组网的带宽为 10Gbps 。详细可以参考[网络:自组网](/docs/networking/private-network)。对于大部分同学来说,不需要选择这个网络。 选择网络后,会看到有一个虚拟网卡选项,这里保持默认即可。手动指定地址会导致云主机创建失败。 @@ -90,7 +90,7 @@ CLab 提供两种硬盘类型,分别是 SSD 和 HDD。SSD 是固态硬盘阵 ## 安全组 -安全组是用来控制云主机的网络访问的。我们为大家设置好了默认的安全组,允许所有的入站和出站流量。如果需要更改安全组,可以在云主机创建后,进入云主机详情页面,点击“安全组”标签页,进行更改。可以参考[网络:安全组](/networking/security-group)。 +安全组是用来控制云主机的网络访问的。我们为大家设置好了默认的安全组,允许所有的入站和出站流量。如果需要更改安全组,可以在云主机创建后,进入云主机详情页面,点击“安全组”标签页,进行更改。可以参考[网络:安全组](/docs/networking/security-group)。 (现在点击页面右下角的“下一步”按钮,进入名称和密钥设置) @@ -131,7 +131,7 @@ ssh 用户名@内网IP # 登陆网关 -未联网前可访问北京大学镜像站 mirrors.pku.edu.cn 获取软件源,请参考[网络:北京大学镜像站](/getting-started/lcpu-mirror)。 +未联网前可访问北京大学镜像站 mirrors.pku.edu.cn 获取软件源,请参考[网络:北京大学镜像站](/docs/getting-started/lcpu-mirror)。 如果云虚拟机需要连接互联网,需要和正常手机电脑一样登陆网关。特别的,如果需要`vscode`连接到主机,则需要联网才能获得较好体验。 diff --git a/getting-started/lcpu-mirror.md b/docs/getting-started/lcpu-mirror.md similarity index 100% rename from getting-started/lcpu-mirror.md rename to docs/getting-started/lcpu-mirror.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..832a480 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,4 @@ +欢迎访问CLab文档,文档目前正在建设中,有以下内容可供查阅,欢迎大家在使用CLab后帮助建设文档,也可在此[填写问卷](https://f.wps.cn/g/1LJPilFH/)。 + +- [快速开始](/docs/getting-started/introduction) +- [镜像站使用指南](/docs/getting-started/lcpu-mirror) diff --git a/networking/private-network.md b/docs/networking/private-network.md similarity index 100% rename from networking/private-network.md rename to docs/networking/private-network.md diff --git a/networking/router-and-floating-ip.md b/docs/networking/router-and-floating-ip.md similarity index 100% rename from networking/router-and-floating-ip.md rename to docs/networking/router-and-floating-ip.md diff --git a/networking/security-group.md b/docs/networking/security-group.md similarity index 100% rename from networking/security-group.md rename to docs/networking/security-group.md diff --git a/storage/advanced.md b/docs/storage/advanced.md similarity index 100% rename from storage/advanced.md rename to docs/storage/advanced.md diff --git a/storage/volume-snapshots-and-backups.md b/docs/storage/volume-snapshots-and-backups.md similarity index 100% rename from storage/volume-snapshots-and-backups.md rename to docs/storage/volume-snapshots-and-backups.md diff --git a/storage/volume-type.md b/docs/storage/volume-type.md similarity index 100% rename from storage/volume-type.md rename to docs/storage/volume-type.md