From 38a67c7925ba584e62bd9ad421f3782659825dc0 Mon Sep 17 00:00:00 2001 From: xxm Date: Thu, 7 Mar 2024 13:54:36 +0800 Subject: [PATCH] =?UTF-8?q?(add):=E6=B7=BB=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=9B=B4=E6=96=B0=E5=9F=BA=E7=A1=80=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e9c3996 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +## 项目说明 + +本项目用于维护和构建中国开源软件推进联盟的站点内容,站点地址为 + +### 项目结构 + +项目结构如下: +```bash +├── LICENSE +├── README.md +├── archetypes +│ └── default.md +├── config.toml +├── content +│ ├── 2022 +│ ├── 2023 +│ ├── 开源发展蓝皮书 +│ ├── 深度信息技术专辑 +│ └── 评人工智能如何走向新阶段 +├── static +│ └── images +└── themes + ├── dot + └── hugo-theme-pdf-js +``` + +#### 站点设置 + +站点相关设置更新 `config.toml` 文件 + +#### 站点内容 + +站点内容更新 `content` 目录下内容,每新增一个内容需要对应增加一个 `xx.md` 文件,其中该文件内容格式为: + +```markdown +--- +title: "第一集" +date: 2020-12-14 +lastmod: 2020-12-14 +weight: 1 +draft: false +# search related keywords +# keywords: ["北京","360"] +--- + + +{{< embed-pdf-view url="/images/第一集.pdf" >}} +``` + +其中: +- `title` : 新增内容的标题 +- `date` : 新增内容在网页上显示的创建日期 +- `lastmod` : 新增内容在网页上显示的更新日期 +- `weight` : 新增内容在当前栏目下的排序 + +正文内容使用 `{{< embed-pdf-view url="/images/第一集.pdf" >}}` ,该内容会在网页上自动渲染 `static/iamges` 目录下对应的 PDF 文件,因此需要将对应的 PDF 文件添加到 `static/iamges` 目录下, PDF 文件尽量用英文命令、且文件名中不要含空格等特殊字符 + + +### 更新站点 + +在熟悉以上内容结构后,就可以开始通过 git 命令来完成 站点内容的更新操作: + +1. git clone 项目到本地 + `git clone git@gitcode.net:COPU/copu.git` +2. 进入目录并开始更新内容 + `cd copu` +3. 添加更新好的内容 + `git add .` + `git commit -m '(add):添加内容说明'` +4. git push 更新内容到 GitCode + `git push origin master` +5. 等待 GitCode 自动运行流水线并使用新的内容构建站点,构建过程可以在 https://gitcode.net/COPU/copu/-/pipelines 中查看 + + +注: 以上操作需要在本地终端进行操作,需要有一定 git 知识,且需要绑定 ssh key,相关操作可以见 https://gitcode.net/-/profile/keys 页面 \ No newline at end of file -- GitLab