Skip to content

Commit

Permalink
doc: Remove bootcdn and staticfile CDN (#723)
Browse files Browse the repository at this point in the history
* Update frontend.md

* Update frontend.md

* add SRI
  • Loading branch information
mercury233 authored Jul 1, 2024
1 parent 885654d commit c24151f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion demo/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title>Twikoo Demo</title>
<link rel="stylesheet" type="text/css" href="https://cdn.staticfile.net/bulma/0.8.2/css/bulma.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.2/css/bulma.min.css" integrity="sha384-ot6RguV46OXVI/scORL3MF0W76aCi4XLFeX3mRArMs/+rNzCpVaOFDtfitKy47nn" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="demo.css">
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/Twikoo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ onMounted(() => {
<component :is="'script'" defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"></component>

<!-- lightGallery -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/lightgallery.css">
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected]/lightgallery.min.js"></component>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/lightgallery.css" integrity="sha384-U8ohOXEVyF0NGY2LQnH83V4wGxOmFhim4U5xhfE/WDCHdPO2iUKPPYkhpDl9U/Yf" crossorigin="anonymous">
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected]/lightgallery.min.js" integrity="sha384-l5lFB9srHFAyvfCoHya9X1JwGGTNPvDtikieqZp7qu/bomCw0e0+yoyiL0f7UXLD" crossorigin="anonymous"></component>

<!-- Twikoo -->
<div id="twikoo"></div>
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/twikoo.min.js" ref="twikooJs"></component>
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/twikoo.min.js" integrity="sha384-ocJyLUeo5I91x224iE/ke7PPHyXVSUKNL7GfqnEto/HxGuBLnLLlitt3dFT/Zwrn" crossorigin="anonymous" ref="twikooJs"></component>
</div>
</template>
6 changes: 3 additions & 3 deletions docs/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ twikoo:

``` html
<div id="tcomment"></div>
<script src="https://cdn.staticfile.net/twikoo/1.6.36/twikoo.all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.36/dist/twikoo.all.min.js" integrity="sha384-4KfOjEinLSkv1i1J8TzlkC/RTnuiLoR1OLerVgjEKoH5djYtbf7mzEFsz9p3nfuA" crossorigin="anonymous"></script>
<script>
twikoo.init({
envId: '您的环境id', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
Expand All @@ -111,11 +111,11 @@ twikoo.init({

如果遇到默认 CDN 加载速度缓慢,可更换其他 CDN 镜像。以下为可供选择的公共 CDN,其中一些 CDN 可能需要数天时间同步最新版本:

* `https://cdn.staticfile.net/twikoo/1.6.36/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.36/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.36/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/[email protected]/dist/twikoo.all.min.js`

> 建议使用 CDN 引入 Twikoo 的用户参考上一段的示例在代码中加入 [SRI](https://developer.mozilla.org/zh-CN/docs/Web/Security/Subresource_Integrity) 属性以确保完整性。
## 开启管理面板(腾讯云环境)

1. 进入[环境-登录授权](https://console.cloud.tencent.com/tcb/env/login),点击“自定义登录”右边的“私钥下载”,下载私钥文件
Expand Down
2 changes: 1 addition & 1 deletion src/client/utils/highlight.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { app } from '../view'

const PRISM_CDN = 'https://cdn.staticfile.net/prism/1.28.0'
const PRISM_CDN = 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0'
let Prism
let cssEl

Expand Down

0 comments on commit c24151f

Please sign in to comment.