You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All notable changes to this project will be documented in this file.
4
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+
## 0.0.2 (2021-09-14)
7
+
8
+
9
+
### Bug Fixes
10
+
11
+
* number secret lead to encrypt failed ([f36df5b](https://github.com/alphawq/vuepress-plugin-posts-encrypt/commit/f36df5bd29524dd04d9ba6ce99fb7e3fafa30534))
12
+
***vuepress-plugin-posts-encrypt:** number secret lead to encrypt failed ([b893eb9](https://github.com/alphawq/vuepress-plugin-posts-encrypt/commit/b893eb9bbbb543b465edd192954e5ec29610ddcd))
Copy file name to clipboardExpand all lines: README.md
+23-16
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,12 @@ English | [简体中文](./README.zh-cn.md)
14
14
```sh
15
15
yarn add vuepress-plugin-posts-encrypt
16
16
```
17
+
17
18
## Usage
18
19
19
-
### Step 1: Init configuration in vuepress config file
20
+
### Step 1: Init configuration in vuepress config file
20
21
21
-
```js
22
+
```js
22
23
// .vuepress/config.js
23
24
module.exports= {
24
25
@@ -35,11 +36,12 @@ module.exports = {
35
36
]
36
37
}
37
38
```
39
+
38
40
👇[All configuration items](#Configs) can be seen at `Configs` part👇
39
41
40
42
### Step 2: Configure the posts that need to be encrypted access in the blog
41
43
42
-
- Set `secret: true` in the article [Front Matter](https://vuepress.vuejs.org/zh/guide/frontmatter.html#%E5%85%B6%E4%BB%96%E6%A0%BC%E5%BC%8F%E7%9A%84-front-matter)
44
+
- Set `secret: true` in the article [Front Matter](https://vuepress.vuejs.org/zh/guide/frontmatter.html#%E5%85%B6%E4%BB%96%E6%A0%BC%E5%BC%8F%E7%9A%84-front-matter)
43
45
44
46
```yml
45
47
---
@@ -72,12 +74,12 @@ passwd: 1233211234567
72
74
73
75
### Step3: Run it & See the effect
74
76
75
-
*BTW*: **Under dev mode `encryptInDev: true` also needs to be configured**
77
+
_BTW_: **Under dev mode `encryptInDev: true` also needs to be configured**
76
78
77
79
Execute the following command to start the development service
78
80
79
81
```sh
80
-
vuepress dev docs
82
+
vuepress dev docs
81
83
```
82
84
83
85
Click to enter a page that needs to verify the password, you can see the following effects:
@@ -88,27 +90,30 @@ Click to enter a page that needs to verify the password, you can see the followi
88
90
89
91
### Support custom templates
90
92
91
-
In the custom template scenario, the plugin needs to inject some logic into your template file, such as `the logic related to password verification`. So you need to provide a mark to inject this part of the code in the template.
93
+
In the custom template scenario, the plugin needs to inject some logic into your template file, such as `the logic related to password verification`. So you need to provide a mark to inject this part of the code in the template.
92
94
93
95
The following marks except `<%crypto_inject_tag%>` & `<%validate_js_tag%>` are required, the others are optional. You are free to choose:
94
96
95
-
*BTW*: **The following marks are inserted into the template from top to bottom, so you need to pay attention to the writing position of the mark**
97
+
_BTW_: **The following marks are inserted into the template from top to bottom, so you need to pay attention to the writing position of the mark**
96
98
97
99
The position markers for content injection in the template include the following
- Need to set `iview: true` in the `injectConfig` configuration
113
118
114
119
#### `<%minified_css_tag%>`[`Optional`]
@@ -117,20 +122,21 @@ The position markers for content injection in the template include the following
117
122
118
123
- If you don't want to write `css` in the template, this configuration allows you to separate the style files that need to be used in the template into the `less` file. The plugin will help you `compile and insert` to the corresponding location. You only need Specify the absolute path of the style file in the `less` setting of `injectConfig`
119
124
120
-
121
125
#### `<%crypto_inject_tag%>`[`Required`]
126
+
122
127
-[`CryptoJS`](https://github.com/brix/crypto-js) Script file insertion position
123
128
124
129
#### `<%validate_js_tag%>`[`Required`]
125
-
> **Password verification** and **Verified routing storage** injection location mark of related logic
130
+
131
+
> **Password verification** and **Verified routing storage** injection location mark of related logic
126
132
127
133
### Support setting password expiration time
128
134
129
135
By default, if the verified route is on the same device and the same browser and the user does not clear the local cache, there is no need to verify again next time you come in, because it is stored in `localstorage`
130
136
131
137
If you don't want this, you can set `expires` for the password, the unit is `milliseconds (ms)`. This expiration time is for each route, not all routes.
132
138
133
-
*BTW*: **Do not set the expiration time too short, otherwise it may cause an endless loop of routing**
139
+
_BTW_: **Do not set the expiration time too short, otherwise it may cause an endless loop of routing**
134
140
135
141
### The following are all supported configuration options:
0 commit comments