Skip to content

Commit

Permalink
chore: update docs link to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 7, 2024
1 parent aaf9824 commit aee6bc6
Show file tree
Hide file tree
Showing 29 changed files with 77 additions and 71 deletions.
4 changes: 2 additions & 2 deletions docs/src/cookbook/customize/highlighter.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ icon: style
<title>Waline highlighter 案例</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<script src="https://unpkg.com/prismjs@v1" data-manual></script>
<script src="https://unpkg.com/prismjs@v1/plugins/autoloader/prism-autoloader.min.js"></script>
Expand All @@ -32,7 +32,7 @@ icon: style
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
const waline = init({
el: '#waline',
Expand Down
8 changes: 4 additions & 4 deletions docs/src/cookbook/customize/tex-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ icon: tex
<title>Waline highlighter 案例</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<link
rel="stylesheet"
Expand All @@ -32,7 +32,7 @@ icon: tex
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from '"https://unpkg.com/@waline/client@v2/dist/waline.mjs"';
import { init } from '"https://unpkg.com/@waline/client@v3/dist/waline.js"';
import katex from 'https://unpkg.com/[email protected]/dist/katex.mjs';
init({
Expand Down Expand Up @@ -64,14 +64,14 @@ icon: tex
<title>Waline highlighter 案例</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<script src="https://unpkg.com/mathjax@v3/es5/tex-svg.js"></script>
</head>
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from '"https://unpkg.com/@waline/client@v2/dist/waline.mjs"';
import { init } from '"https://unpkg.com/@waline/client@v3/dist/waline.js"';
init({
el: '#waline',
Expand Down
4 changes: 2 additions & 2 deletions docs/src/cookbook/customize/upload-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ icon: pic
<title>Waline imageUploader 案例</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
</head>
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
const waline = init({
el: '#waline',
Expand Down
8 changes: 4 additions & 4 deletions docs/src/cookbook/import/cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ icon: import
<!-- 样式文件 -->
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<!-- 脚本文件 -->
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
// options
Expand All @@ -39,7 +39,7 @@ icon: import

```html
<script type="module">
import { pageviewCount } from 'https://unpkg.com/@waline/client@v2/dist/pageview.mjs';
import { pageviewCount } from 'https://unpkg.com/@waline/client@v3/dist/pageview.js';
pageviewCount({
// options
Expand All @@ -51,7 +51,7 @@ icon: import

```html
<script type="module">
import { commentCount } from 'https://unpkg.com/@waline/client@v2/dist/comment.mjs';
import { commentCount } from 'https://unpkg.com/@waline/client@v3/dist/comment.js';
commentCount({
// options
Expand Down
4 changes: 2 additions & 2 deletions docs/src/en/cookbook/customize/highlighter.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This cookbook guides you how to add your own code highlighter.
<title>Waline highlighter case</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<script src="https://unpkg.com/prismjs@v1" data-manual></script>
<script src="https://unpkg.com/prismjs@v1/plugins/autoloader/prism-autoloader.min.js"></script>
Expand All @@ -32,7 +32,7 @@ This cookbook guides you how to add your own code highlighter.
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
const waline = init({
el: '#waline',
Expand Down
8 changes: 4 additions & 4 deletions docs/src/en/cookbook/customize/tex-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For KaTeX options, see [KaTeX API](https://katex.org/docs/api.html#server-side-r
<title>Waline highlighter case</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<link
rel="stylesheet"
Expand All @@ -31,7 +31,7 @@ For KaTeX options, see [KaTeX API](https://katex.org/docs/api.html#server-side-r
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from '"https://unpkg.com/@waline/client@v2/dist/waline.mjs"';
import { init } from '"https://unpkg.com/@waline/client@v3/dist/waline.js"';
import katex from 'https://unpkg.com/[email protected]/dist/katex.mjs';
init({
Expand Down Expand Up @@ -63,14 +63,14 @@ For MathJax options, see [MathJax API](http://docs.mathjax.org/en/latest/web/typ
<title>Waline highlighter case</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<script src="https://unpkg.com/mathjax@v3/es5/tex-svg.js"></script>
</head>
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from '"https://unpkg.com/@waline/client@v2/dist/waline.mjs"';
import { init } from '"https://unpkg.com/@waline/client@v3/dist/waline.js"';
init({
el: '#waline',
Expand Down
4 changes: 2 additions & 2 deletions docs/src/en/cookbook/customize/upload-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ An example of using the `lsky-pro` graph bed.
<title>Waline imageUploader demo</title>
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
</head>
<body>
<div id="waline" style="max-width: 800px; margin: 0 auto"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
const waline = init({
el: '#waline',
Expand Down
8 changes: 4 additions & 4 deletions docs/src/en/cookbook/import/cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Normally, you may want Waline to render a list of comments, you can import Walin
<!-- style file -->
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
<!-- script file -->
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
// options
Expand All @@ -39,7 +39,7 @@ Pageviews:

```html
<script type="module">
import { pageviewCount } from 'https://unpkg.com/@waline/client@v2/dist/pageview.mjs';
import { pageviewCount } from 'https://unpkg.com/@waline/client@v3/dist/pageview.js';
pageviewCount({
// options
Expand All @@ -51,7 +51,7 @@ Comments count:

```html
<script type="module">
import { commentCount } from 'https://unpkg.com/@waline/client@v2/dist/comment.mjs';
import { commentCount } from 'https://unpkg.com/@waline/client@v3/dist/comment.js';
commentCount({
// options
Expand Down
6 changes: 3 additions & 3 deletions docs/src/en/guide/features/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can enable comment counting in the `init` function by setting the `comment`

```html
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
el: '#waline',
Expand Down Expand Up @@ -56,7 +56,7 @@ Besides automatically update via the `init` function, you can manually update th

```html
<script type="module">
import { commentCount } from 'https://unpkg.com/@waline/client@v2/dist/comment.mjs';
import { commentCount } from 'https://unpkg.com/@waline/client@v3/dist/comment.js';
commentCount({
serverURL,
Expand Down Expand Up @@ -92,7 +92,7 @@ Sometimes, you may want to display the comment count of some pages in the articl

```html
<script type="module">
import { commentCount } from 'https://unpkg.com/@waline/client@v2/dist/comment.mjs';
import { commentCount } from 'https://unpkg.com/@waline/client@v3/dist/comment.js';
commentCount({
serverURL,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/en/guide/features/emoji.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Waline DO NOT have any copyright of above emojis, use them at your own risk.
```html
<div id="waline"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
el: '#waline',
Expand Down
20 changes: 12 additions & 8 deletions docs/src/en/guide/features/pageview.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If you only need to use the pageview statistics function, you can import the pag
</li>
</ul>
<script type="module">
import { pageviewCount } from 'https://unpkg.com/@waline/client/dist/pageview.mjs';
import { pageviewCount } from 'https://unpkg.com/@waline/client@v3/dist/pageview.js';
pageviewCount({
serverURL: '<YOUR_SERVER_URL>',
Expand All @@ -85,14 +85,18 @@ Since pageview fetching is an asynchronous network operation, you may need to ca

`pageviewCount` returns a function that can be called to cancel the update:

```js
const abort = Waline.pageviewCount({
serverURL: '<YOUR_SERVER_URL>',
path: window.location.pathname,
});
```html
<script type="module">
import { pageviewCount } from 'https://unpkg.com/@waline/client@v3/dist/pageview.js';
// After 500ms, if the network request has not been completed, cancel this operation
setTimeout(() => abort(), 500);
const abort = Waline.pageviewCount({
serverURL: '<YOUR_SERVER_URL>',
path: window.location.pathname,
});
// After 500ms, if the network request has not been completed, cancel this operation
setTimeout(() => abort(), 500);
</script>
```

:::
2 changes: 1 addition & 1 deletion docs/src/en/guide/features/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For CDN users, you can import via the following link:
<!-- Meta icon (optional) -->
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline-meta.css"
href="https://unpkg.com/@waline/client@v3/dist/waline-meta.css"
/>
```

Expand Down
8 changes: 4 additions & 4 deletions docs/src/en/guide/get-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ Welcome to Waline. In just a few steps, you can enable Waline to provide comment

Here is how you can implement Waline on your web page:

1. Import the stylesheet `https://unpkg.com/@waline/client@v2/dist/waline.css` in the `<head>`
1. Import the stylesheet `https://unpkg.com/@waline/client@v3/dist/waline.css` in the `<head>`

1. Create a `<script>` tag and initialize with `init()` from `https://unpkg.com/@waline/client@v2/dist/waline.mjs` while passing in the necessary `el` and `serverURL` options.
1. Create a `<script>` tag and initialize with `init()` from `https://unpkg.com/@waline/client@v3/dist/waline.js` while passing in the necessary `el` and `serverURL` options.

- The `el` option is the element used for Waline rendering. You can set a CSS selector in the form of a string or an HTMLElement object.
- `serverURL` is the link of the server, which you just created in Vercel.
Expand All @@ -96,14 +96,14 @@ Here is how you can implement Waline on your web page:
<!-- ... -->
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline.css"
href="https://unpkg.com/@waline/client@v3/dist/waline.css"
/>
</head>
<body>
<!-- ... -->
<div id="waline"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
el: '#waline',
Expand Down
6 changes: 3 additions & 3 deletions docs/src/guide/features/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Waline 支持显示评论数。

```html
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
el: '#waline',
Expand Down Expand Up @@ -60,7 +60,7 @@ Waline 会在初始化以及每次 path 更新时,自动查找页面中 `class

```html
<script type="module">
import { commentCount } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { commentCount } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
commentCount({
serverURL,
Expand Down Expand Up @@ -96,7 +96,7 @@ setTimeout(() => abort(), 500);

```html
<script type="module">
import { commentCount } from 'https://unpkg.com/@waline/client@v2/dist/comment.mjs';
import { commentCount } from 'https://unpkg.com/@waline/client@v3/dist/comment.js';
commentCount({
serverURL,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/features/emoji.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Waline 不含有上述 Emoji 表情的任何版权,你需要自行承担使用
```html
<div id="waline"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
el: '#waline',
Expand Down
6 changes: 3 additions & 3 deletions docs/src/guide/features/pageview.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Waline 支持浏览量统计。
<!-- 文章内容 -->
<div id="waline"></div>
<script type="module">
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
init({
el: '#waline',
Expand Down Expand Up @@ -70,7 +70,7 @@ Waline 会在初始化以及每次 path 更新时,自动查找页面中 `class
</li>
</ul>
<script type="module">
import { pageviewCount } from 'https://unpkg.com/@waline/client/dist/pageview.mjs';
import { pageviewCount } from 'https://unpkg.com/@waline/client@v3/dist/pageview.js';
pageviewCount({
serverURL: '<YOUR_SERVER_URL>',
Expand All @@ -97,7 +97,7 @@ Waline 会在初始化以及每次 path 更新时,自动查找页面中 `class

```html
<script type="module">
import { pageviewCount } from 'https://unpkg.com/@waline/client/dist/pageview.mjs';
import { pageviewCount } from 'https://unpkg.com/@waline/client@v3/dist/pageview.js';
const abort = pageviewCount({
serverURL: '<YOUR_SERVER_URL>',
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/features/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ redirectFrom: /guide/client/style.html
<!-- Meta 图标 (可选) -->
<link
rel="stylesheet"
href="https://unpkg.com/@waline/client@v2/dist/waline-meta.css"
href="https://unpkg.com/@waline/client@v3/dist/waline-meta.css"
/>
```

Expand Down
Loading

0 comments on commit aee6bc6

Please sign in to comment.