Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
jxtxzzw
resume
Commits
b10cbebd
Verified
Commit
b10cbebd
authored
Dec 16, 2020
by
jxtxzzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README
Signed-off-by:
jxtxzzw
<
jxtxzzw@126.com
>
parent
850974ce
Pipeline
#187
passed with stages
in 8 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
22 deletions
+42
-22
README.md
README.md
+42
-11
static/README.md
static/README.md
+0
-11
No files found.
README.md
View file @
b10cbebd
...
...
@@ -55,13 +55,15 @@
2.
使用 JSON 文件存放数据,而不是数据库的方式,是为了方便部署在类似于 GitHub Pages 这样不支持后端环境的平台上
一般来说,个人简历的信息很少更新,所以可以不需要数据库的支持
而且个人简历的信息是完全公开的,不涉及用户权限的问题,可以全部展示,也不需要数据库的参与
一般来说,个人简历的信息很少更新,所以可以不需要数据库的支持,而且个人简历的信息是完全公开的,不涉及用户权限的问题(无登录、无鉴权),可以全部展示,也不需要数据库的参与
如果数据是存放在数据库中,可以使用脚本提前导出,
`sql_to_json_converter.js`
提供了一个脚本,将
`.sql`
文件转化为
`.json`
文件,你只需要使用
`mysqldump`
这样的命令导出相应的表然后运行这个脚本,注意
`\` 转义已经被消除,如果你的需要转义后的 `
\`
,你可以自己修改
`stringify`
前后的代码
你也可以安装
`Sequelize`
或者
`Mongoose`
这样的模块,并修改
`/assets/reader.js`
以便从数据库获取数据,或者采用前后端分离的部署方法,利用
`axios`
等手段获取数据
考虑到 MySQL 中没有原生数组的支持,所以很多文件都是采用了
`,`
分隔,然后调用
`.split(',')`
得到数组,如果你使用的是 MongoDB 这样的数据库,你可以修改对应的代码,直接使用数组
你也可以安装
`Sequelize`
或者
`Mongoose`
这样的模块,并修改
`/assets/reader.js`
以便从数据库获取数据
或者采用前后端分离的部署方法,利用
`axios`
等手段获取数据
3.
如果需要部署到 GitHub Pages,你还需要在
`/static/`
目录下创建一个
`.nojekyll`
的文件
...
...
@@ -71,7 +73,7 @@
`.gitlab.yml`
中,
`load_resources`
是获取资源,
`deploy`
中实现了本地部署(上传到服务器)、GitHub Pages(利用 pull 和 push),以及 GitLab Pages(利用 GitLab Runner 的自动部署)
`setting.json`
中的
`updated`
可以自动修改,利用命令
`sed`
`setting.json`
中的
`updated`
可以自动修改,利用命令
`sed`
搜索匹配的内容,并完成替换
在
`.gitlab-ci.yml`
中,这个命令是
...
...
@@ -79,7 +81,7 @@
sed \"s/\\\"updated\\\":[ ]*\\\"[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\\"/\\\"updated\\\":\\\"${RESUME_DATE}\\\"/g\"
```
你也许需要修改
转义 `\` 的次数
使用不同的 `yml` 工具可能会有不同的
转义 `\` 的次数
5.
你可以随意修改代码,删除你不需要的内容,或者增加、修改其他的功能
...
...
@@ -91,6 +93,8 @@
9.
更新时,只需要下载(或者克隆)最新的项目文件,将
`/assets/data/`
和
`/static/data/`
复制到新的项目文件夹中,重新运行这些命令即可,无需再次编辑数据
10.
(暂时)没有做移动端适配(没有响应式布局),你可以自己修改
## 面向初级用户的使用说明 (For Beginners)
1.
在 https://nodejs.org/en/ 下载 LTS 版的 Node.js
...
...
@@ -109,11 +113,9 @@
8.
编辑
`/assets/data/settings.json`
,修改
`updated`
为当天的日期
9.
编辑
`/assets/data/`
中除了
`matomo.json`
以外的
`.json`
文件,仿照样例的格式,输入你想要展示的内容,例如对
`introduction.json`
做如下修改
明确不需要的字段,例如没有内容、不适用,这样的字段请设置为
`null`
9.
编辑
`/assets/data/`
中除了
`matomo.json`
以外的
`.json`
文件,仿照样例的格式,输入你想要展示的内容
如果你不清楚某些字段的作用,或者你不需要这些字段,例如,也许你的轻博客不需要跳转到正式博客,那么,这些内容可以保留为
`null`
或者
`""`
例如对
`introduction.json`
做如下修改
```json
{
...
...
@@ -124,6 +126,35 @@
"qq_qr": "/data/introduction/qrcode_qq.jpg"
}
```
又比如在
`study.json`
文件中,在
`[]`
之间增加其他的记录
```json
[
{
"school": "中学",
"date": "2011-09-01",
"end": "2011-10-01",
"content": "某中学录取"
},
{
"school": "大学",
"date": "2011-10-01",
"end": null,
"content": "位于上海,至今,附加说明……"
},
{
"school": "小学",
"date": "2010-11-10",
"end": null,
"content": "增加的记录"
}
]
```
明确不需要的字段,例如没有内容、不适用,这样的字段请设置为
`null`
如果你不清楚某些字段的作用,或者你不需要这些字段,例如,也许你的轻博客不需要跳转到正式博客,那么,这些内容可以保留为
`null`
或者
`""`
10.
将图片等资源复制到
`/static/data/`
中对应的文件夹
...
...
@@ -153,7 +184,7 @@
你也可以使用 Nginx 这样的工具完成代理,将你的域名转发到 3000 端口上
注意这种情况下,服务需要处于运行状态,
因此
如果你打算关掉 SSH,你最好使用 screen 这样的工具,或者
加上 & 符号
后台运行
注意这种情况下,
`npm run start`
服务需要处于运行状态,如果你打算关掉 SSH,
这个服务可能也会被关闭,因此,
你最好使用
`
screen
`
这样的工具
确保
,或者
使用 `npm run start &` 确保服务在
后台运行
请自行搜索关键词为 `服务器维护` 、 `Nginx 端口转发` 、 `域名配置` 相关的教程
...
...
static/README.md
deleted
100644 → 0
View file @
850974ce
# STATIC
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your static files.
Each file inside this directory is mapped to
`/`
.
Thus you'd want to delete this README.md before deploying to production.
Example:
`/static/robots.txt`
is mapped as
`/robots.txt`
.
More information about the usage of this directory in
[
the documentation
](
https://nuxtjs.org/guide/assets#static
)
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment