This commit is contained in:
江志雄 2019-01-10 18:01:41 +08:00
parent 7de5fc5825
commit dacf3d1645
7 changed files with 164 additions and 11 deletions

View File

@ -16,7 +16,7 @@ before_script:
# 无其他依赖项所以执行npm run build 构建就行了 # 无其他依赖项所以执行npm run build 构建就行了
script: script:
- npm run generate - npm run g
after_script: after_script:
- cd ./public - cd ./public

View File

@ -1,9 +1,4 @@
# Change Log
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## 1.0.1 (2019-01-10) ## 1.0.1 (2019-01-10)
# 0.0.0 (2019-01-10)

View File

@ -5,7 +5,7 @@
# Site # Site
title: Feax's Blog title: Feax's Blog
subtitle: subtitle:
description: web全栈工程师,摇滚,vue,vuex,react,webpack,git,koa2 description: web,vue,react,webpack,node
author: Feax author: Feax
language: zh-CN language: zh-CN
timezone: timezone:

File diff suppressed because one or more lines are too long

View File

@ -3,18 +3,21 @@
"version": "1.0.1", "version": "1.0.1",
"private": true, "private": true,
"author": "Feax", "author": "Feax",
"description": "博客备份",
"main": "index.js",
"hexo": { "hexo": {
"version": "3.7.1" "version": "3.7.1"
}, },
"scripts": { "scripts": {
"new": "hexo new ${title}", "new": "hexo new ${title}",
"s": "hexo s", "s": "hexo s",
"generate": "hexo generate", "g": "hexo g",
"init": "commitizen init cz-conventional-changelog --save --save-exact",
"commit": "git cz", "commit": "git cz",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md", "log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"release": "./scripts/release.sh", "release": "./scripts/release.sh",
"changeissueurl": "replace 'https://github.com/myproject/issues/' 'https://redmine.example.com/' CHANGELOG.md", "changeissueurl": "replace 'https://github.com/myproject/issues/' 'https://redmine.example.com/' CHANGELOG.md",
"version": "standard-version" "setv": "standard-version"
}, },
"dependencies": { "dependencies": {
"hexo": "^3.2.0", "hexo": "^3.2.0",
@ -40,6 +43,9 @@
"devDependencies": { "devDependencies": {
"commitizen": "^3.0.5", "commitizen": "^3.0.5",
"conventional-changelog-cli": "^2.0.11", "conventional-changelog-cli": "^2.0.11",
"cz-conventional-changelog": "^2.1.0",
"standard-version": "^4.4.0" "standard-version": "^4.4.0"
} },
"repository": "ssh://git@github.com/j710328466/j710328466.github.io.git",
"license": "MIT"
} }

View File

@ -0,0 +1,110 @@
---
title: changelog 自动化入门
date: 2019-01-10 10:40:03
tags: [changelog, node]
categories: web前端
---
# 初衷
在团队作战中,为了记录版本更新情况,往往需要一个日志进行记录每个版本功能的变化。但是目前公司使用的是人工纯手动生成日志,效率比较低,而且记录的不够详细。
## 预期实现功能
* 每次提交 commit 信息能够更直观,形成一定规范。
* 自动记录更新后重要的内容同步到 changeLog.md。
## log 相关工具
该文章主要介绍以下几款工具的组合使用:
* conventional-changelog-cli 核心命令行工具
* commitizen 简单的 commit 格式工具
* standard-version 版本管理工具
## GIT commit 格式介绍
```html
<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
<footer>
```
> 其中 Body 和 Footer 可以省略
### type
用于说明 commit 类别,以下给出几种类型代表的含义:
* feat 新功能
* fix Bug 修复
* docs 文档更新
* style 代码的格式,标点符号的更新
* refactor 代码重构
* perf 性能优化
* test 测试更新
* build 构建系统或者包依赖更新
* ci CI 配置,脚本文件等更新
* chore 非 src 或者 测试文件的更新
* revert commit 回退
### Scope
用于说明 commit 影响的范围,比如数据层,控制层,视图层,以实际项目为准。
### Subject
简单的描述,只有一行,以动词开头,不超过 50 个字符。
### Body
对本次 commit 的详细描述,可以多行,每行不超过 100 个字符。
> 应该说明代码变动的动机,和以前的行为对比。
### Footer
分为两种情况:
#### 1. 不兼容变动
如果当前代码和上一个版本不兼容,则以 BREAKING CHANGE 开头,后面是对变动的描述,以及变动理由和迁移方法。
```md
BREAKING CHANGE: isolate scope bindings definition has changed.
To migrate the code follow the example below:
Before:
scope: {
myAttr: 'attribute',
}
After:
scope: {
myAttr: '@',
}
The removed `inject` wasn't generaly useful for directives so there should be no code using it.
```
#### 2. 关闭 issue
如果当前 commit 针对某个 issue 那么可以在 Footer 部分关闭这个 Issue。
```md
Close #1234,#4566...
```
### Revert
当前 Commit 用于撤销以前的 Commit 时, 必须以 Revert 开头,后面跟着被撤销的 Commit 的 Header。
```md
revert: feat(pencil): add 'graphiteWidth' option
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
```

View File

@ -0,0 +1,42 @@
---
title: 网站seo入门
date: 2018-12-31 12:17:13
tags: [seo]
categories: web前端
---
# 初衷
为了提升网站排名
## 介绍
* SEO
* SEM
> seo 免费优化周期长。sem 车本高,周期短。
## 目前较有规模的引擎
* 百度
* google
* 360
* 搜狗
* bing
## 搜索引擎三要素
* 标题title
* 描述description
* 关键词keywords
## 外链
通过权重高的友情链接,搜索蜘蛛会继续爬取该页面的外链
> 注意有选择交换,防止灌水式外链
## 内链
可以给关键字加上链接,蜘蛛会去一层层爬取。
## 权重加分
* 代码规范