Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
D0n9X1n committed Jun 9, 2023
1 parent a98a715 commit edaf109
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ It will be called after the blog is decrypted.

Demo: [Callback Example](https://mhexo.github.io/2020/12/06/Callback-Test/).

### After Decrypt Event
Thanks to @[f-dong](https://github.com/f-dong), we now will trigger a event named `hexo-blog-decrypt`, so you can add a call back to listen to that event.

```
// trigger event
var event = new Event('hexo-blog-decrypt');
window.dispatchEvent(event);
```

### Encrypt TOC

If you has a post with TOC, you should change the code of your template. Take the default theme 'landscape' as an example:
Expand Down
9 changes: 9 additions & 0 deletions ReadMe.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ It will be called after the blog decrypted.

例子在: [Callback 例子](https://mhexo.github.io/2020/12/06/Callback-Test/).

### 解密后的触发事件
感谢 @[f-dong](https://github.com/f-dong), 我们现在会在解密完成后触发一个 `hexo-blog-decrypt` 事件, 你们可以编写 callback 来监听该事件.

```
// trigger event
var event = new Event('hexo-blog-decrypt');
window.dispatchEvent(event);
```

### 对 TOC 进行加密

如果你有一篇文章使用了 TOC,你需要修改模板的部分代码。这里用 landscape 作为例子:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint --ext .js ./"
},
"version": "3.1.6",
"version": "3.1.8",
"devDependencies": {
"eslint": "^6.2.2"
}
Expand Down

0 comments on commit edaf109

Please sign in to comment.