Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-abbrlink

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-abbrlink - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

lib/crc16.js

@@ -0,1 +1,3 @@

'use strict';
let deal = function(crc, b) {

@@ -2,0 +4,0 @@ return (crc >> 8) ^ CrcTable[(crc & 0xFF) ^ b];

19

lib/logic.js

@@ -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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc