hexo-abbrlink
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
let deal = function(crc, b) { | ||
@@ -2,0 +4,0 @@ return (crc >> 8) ^ CrcTable[(crc & 0xFF) ^ b]; |
@@ -8,12 +8,2 @@ 'use strict'; | ||
let checKCrc = function(res) { | ||
if (crcRes.indexOf(res) > -1) { | ||
res++; | ||
return checKCrc(res); | ||
} else { | ||
return res; | ||
} | ||
} | ||
let logic = function(data) { | ||
@@ -26,13 +16,12 @@ var log = this.log; | ||
abbrlink = model.check(res); | ||
console.log("sfasdfasdf:", abbrlink); | ||
data.abbrlink = abbrlink; | ||
//重新解析font matter | ||
//re parse front matter | ||
var tmpPost = front.parse(data.raw); | ||
//添加我们生成的链接 | ||
//add new generated link | ||
tmpPost.abbrlink = abbrlink; | ||
//生成处理后的文章 | ||
//process post | ||
let postStr = front.stringify(tmpPost); | ||
postStr = '---\n' + postStr; | ||
fs.writeFileSync(data.full_source, postStr, 'utf-8'); | ||
log.i("已为%s生成连接%s", data.title, abbrlink); | ||
log.i("Generate link %s for post [%s]", abbrlink, data.title); | ||
} | ||
@@ -39,0 +28,0 @@ model.add(abbrlink); |
{ | ||
"name": "hexo-abbrlink", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "create one and only link for every post for hexo", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# hexo-abbrlink | ||
## info | ||
A [Hexo plugin](https://hexo.io/plugins/) to generate static post link based on post title and time. | ||
see [this](https://post.zz173.com/detail/hexo-abbrlink.html) | ||
## How to install | ||
Add plugin to Hexo: | ||
``` | ||
npm install hexo-abbrlink --save | ||
``` | ||
Modify permalink in config.yml file: | ||
``` | ||
permalink: posts/:abbrlink/ | ||
``` | ||
## Sample | ||
The generated link will look like the following: | ||
``` | ||
https://post.zz173.com/posts/65535.html | ||
``` | ||
## Limitation | ||
Maximum number of posts is 65535. (For a personal blog site, this number is decent) | ||
## More info | ||
see [this](https://post.zz173.com/detail/hexo-abbrlink.html)(Chinese) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5493
33
98