Skip to content

Commit

Permalink
fix static cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou26 committed Jul 31, 2024
1 parent 26ed848 commit dd22b76
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GHCR_PAT }}
with:
tag_name: v2.1.0
tag_name: v2.1.1
files: |
duck2api-linux-amd64.tar.gz
duck2api-windows-amd64.tar.gz
Expand Down
30 changes: 17 additions & 13 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3003,12 +3003,13 @@
</div>
</div>
</div>
<link crossorigin="anonymous" href="https://cdn.staticfile.org/github-markdown-css/5.3.0/github-markdown-light.min.css"
<link crossorigin="anonymous"
href="https://fastly.jsdelivr.net/npm/[email protected]/github-markdown-light.min.css" rel="stylesheet">
<link crossorigin="anonymous"
href="https://fastly.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/github.min.css"
rel="stylesheet">
<link crossorigin="anonymous" href="https://cdn.staticfile.org/highlight.js/11.9.0/styles/github.min.css"
rel="stylesheet">
<link crossorigin="anonymous" href="https://cdn.staticfile.org/notyf/3.10.0/notyf.min.css" rel="stylesheet">
<script crossorigin="anonymous" src="https://cdn.staticfile.org/notyf/3.10.0/notyf.min.js"></script>
<link crossorigin="anonymous" href="https://fastly.jsdelivr.net/npm/[email protected]/notyf.min.css" rel="stylesheet">
<script crossorigin="anonymous" src="https://fastly.jsdelivr.net/npm/[email protected]/notyf.min.js"></script>
<script>
const notyf = new Notyf({
position: { x: "center", y: "top" },
Expand All @@ -3033,7 +3034,7 @@
const isMobile = navigator.userAgent.match(/iPhone|iPad|iPod|Android|BlackBerry|webOS/);
if (isMobile) {
const script = document.createElement("script");
script.src = "https://cdn.jsdelivr.net/gh/timruffles/[email protected]/release/index.min.js";
script.src = "https://fastly.jsdelivr.net/gh/timruffles/[email protected]/release/index.min.js";
script.crossOrigin = "anonymous";
script.defer = true;
script.onload = () => {
Expand All @@ -3043,7 +3044,7 @@
const link = document.createElement("link");
link.crossOrigin = "anonymous";
link.rel = "stylesheet";
link.href = "https://cdn.jsdelivr.net/gh/timruffles/[email protected]/release/default.css";
link.href = "https://fastly.jsdelivr.net/gh/timruffles/[email protected]/release/default.css";
document.body.appendChild(link);
}
let envAPIEndpoint, envAPIKey;
Expand Down Expand Up @@ -4352,9 +4353,11 @@
};
speechServiceEle.dispatchEvent(new Event("change"));
</script>
<script crossorigin="anonymous" src="https://cdn.staticfile.org/markdown-it/13.0.2/markdown-it.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.staticfile.org/highlight.js/11.9.0/highlight.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.staticfile.org/KaTeX/0.16.9/katex.min.js"></script>
<script crossorigin="anonymous"
src="https://fastly.jsdelivr.net/npm/[email protected]/dist/markdown-it.min.js"></script>
<script crossorigin="anonymous"
src="https://fastly.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<script crossorigin="anonymous" src="https://fastly.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script>
<script>
// from [email protected]
function escapeHTML(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function texmath(e,t){const n=texmath.mergeDelimiters(t&&t.delimiters),a=t&&t.outerSpace||!1,o=t&&t.katexOptions||{};o.throwOnError=o.throwOnError||!1,o.macros=o.macros||t&&t.macros,texmath.katex||(t&&"object"==typeof t.engine?texmath.katex=t.engine:"object"==typeof module?texmath.katex=require("katex"):texmath.katex={renderToString:()=>"No math renderer found."});for(const t of n.inline)a&&"outerSpace"in t&&(t.outerSpace=!0),e.inline.ruler.before("escape",t.name,texmath.inline(t)),e.renderer.rules[t.name]=(e,n)=>t.tmpl.replace(/\$1/,texmath.render(e[n].content,!!t.displayMode,o));for(const t of n.block)e.block.ruler.before("fence",t.name,texmath.block(t)),e.renderer.rules[t.name]=(e,n)=>t.tmpl.replace(/\$2/,escapeHTML(e[n].info)).replace(/\$1/,texmath.render(e[n].content,!0,o))}texmath.mergeDelimiters=function(e){const t=Array.isArray(e)?e:"string"==typeof e?[e]:["dollars"],n={inline:[],block:[]};for(const e of t)e in texmath.rules&&(n.inline.push(...texmath.rules[e].inline),n.block.push(...texmath.rules[e].block));return n},texmath.inline=e=>function(t,n){const a=t.pos,o=t.src,r=o.startsWith(e.tag,e.rex.lastIndex=a)&&(!e.pre||e.pre(o,e.outerSpace,a))&&e.rex.exec(o),s=!!r&&a<e.rex.lastIndex&&(!e.post||e.post(o,e.outerSpace,e.rex.lastIndex-1));if(s){if(!n){const n=t.push(e.name,"math",0);n.content=r[1],n.markup=e.tag}t.pos=e.rex.lastIndex}return s},texmath.block=e=>function(t,n,a,o){const r=t.bMarks[n]+t.tShift[n],s=t.src,m=s.startsWith(e.tag,e.rex.lastIndex=r)&&(!e.pre||e.pre(s,!1,r))&&e.rex.exec(s),l=!!m&&r<e.rex.lastIndex&&(!e.post||e.post(s,!1,e.rex.lastIndex-1));if(l&&!o){const o=e.rex.lastIndex-1;let r;for(r=n;r<a&&!(o>=t.bMarks[r]+t.tShift[r]&&o<=t.eMarks[r]);r++);const s=t.lineMax,l=t.parentType;t.lineMax=r,t.parentType="math","blockquote"===l&&(m[1]=m[1].replace(/(\n*?^(?:\s*>)+)/gm,""));let c=t.push(e.name,"math",0);c.block=!0,c.tag=e.tag,c.markup="",c.content=m[1],c.info=m[m.length-1],c.map=[n,r+1],t.parentType=l,t.lineMax=s,t.line=r+1}return l},texmath.render=function(e,t,n){let a;n.displayMode=t;try{a=texmath.katex.renderToString(e,n)}catch(t){a=escapeHTML(`${e}:${t.message}`)}return a},texmath.inlineRuleNames=["math_inline","math_inline_double"],texmath.blockRuleNames=["math_block","math_block_eqno"],texmath.$_pre=(e,t,n)=>{const a=n>0&&e[n-1].charCodeAt(0);return t?!a||32===a:!a||92!==a&&(a<48||a>57)},texmath.$_post=(e,t,n)=>{const a=e[n+1]&&e[n+1].charCodeAt(0);return t?!a||32===a||46===a||44===a||59===a:!a||a<48||a>57},texmath.rules={brackets:{inline:[{name:"math_inline",rex:/\\\((.+?)\\\)/gy,tmpl:"<eq>$1</eq>",tag:"\\("}],block:[{name:"math_block_eqno",rex:/\\\[(((?!\\\]|\\\[)[\s\S])+?)\\\]\s*?\(([^)$\r\n]+?)\)/gmy,tmpl:'<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',tag:"\\["},{name:"math_block",rex:/\\\[([\s\S]+?)\\\]/gmy,tmpl:"<section><eqn>$1</eqn></section>",tag:"\\["}]},doxygen:{inline:[{name:"math_inline",rex:/\\f\$(.+?)\\f\$/gy,tmpl:"<eq>$1</eq>",tag:"\\f$"}],block:[{name:"math_block_eqno",rex:/\\f\[([^]+?)\\f\]\s*?\(([^)\s]+?)\)/gmy,tmpl:'<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',tag:"\\f["},{name:"math_block",rex:/\\f\[([^]+?)\\f\]/gmy,tmpl:"<section><eqn>$1</eqn></section>",tag:"\\f["}]},gitlab:{inline:[{name:"math_inline",rex:/\$`(.+?)`\$/gy,tmpl:"<eq>$1</eq>",tag:"$`"}],block:[{name:"math_block_eqno",rex:/`{3}math\s*([^`]+?)\s*?`{3}\s*\(([^)\r\n]+?)\)/gm,tmpl:'<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',tag:"```math"},{name:"math_block",rex:/`{3}math\s*([^`]*?)\s*`{3}/gm,tmpl:"<section><eqn>$1</eqn></section>",tag:"```math"}]},julia:{inline:[{name:"math_inline",rex:/`{2}([^`]+?)`{2}/gy,tmpl:"<eq>$1</eq>",tag:"``"},{name:"math_inline",rex:/\$((?:\S?)|(?:\S.*?\S))\$/gy,tmpl:"<eq>$1</eq>",tag:"$",spaceEnclosed:!1,pre:texmath.$_pre,post:texmath.$_post}],block:[{name:"math_block_eqno",rex:/`{3}math\s+?([^`]+?)\s+?`{3}\s*?\(([^)$\r\n]+?)\)/gmy,tmpl:'<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',tag:"```math"},{name:"math_block",rex:/`{3}math\s+?([^`]+?)\s+?`{3}/gmy,tmpl:"<section><eqn>$1</eqn></section>",tag:"```math"}]},kramdown:{inline:[{name:"math_inline",rex:/\${2}(.+?)\${2}/gy,tmpl:"<eq>$1</eq>",tag:"$$"}],block:[{name:"math_block_eqno",rex:/\${2}([^$]+?)\${2}\s*?\(([^)\s]+?)\)/gmy,tmpl:'<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',tag:"$$"},{name:"math_block",rex:/\${2}([^$]+?)\${2}/gmy,tmpl:"<section><eqn>$1</eqn></section>",tag:"$$"}]},beg_end:{inline:[],block:[{name:"math_block",rex:/(\\(?:begin)\{([a-z]+)\}[\s\S]+?\\(?:end)\{\2\})/gmy,tmpl:"<section><eqn>$1</eqn></section>",tag:"\\"}]},dollars:{inline:[{name:"math_inline_double",rex:/\${2}([^$]*?[^\\])\${2}/gy,tmpl:"<section><eqn>$1</eqn></section>",tag:"$$",displayMode:!0,pre:texmath.$_pre,post:texmath.$_post},{name:"math_inline",rex:/\$((?:[^\s\\])|(?:\S.*?[^\s\\]))\$/gy,tmpl:"<eq>$1</eq>",tag:"$",outerSpace:!1,pre:texmath.$_pre,post:texmath.$_post}],block:[{name:"math_block_eqno",rex:/\${2}([^$]*?[^\\])\${2}\s*?\(([^)\s]+?)\)/gmy,tmpl:'<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',tag:"$$"},{name:"math_block",rex:/\${2}([^$]*?[^\\])\${2}/gmy,tmpl:"<section><eqn>$1</eqn></section>",tag:"$$"}]}};
Expand Down Expand Up @@ -6954,7 +6957,8 @@
}
}
</script>
<link crossorigin="anonymous" href="//cdn.staticfile.org/KaTeX/0.16.9/katex.min.css" rel="stylesheet">
<link crossorigin="anonymous" href="https://fastly.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
rel="stylesheet">
<script defer>
let downRoleController = new AbortController();
const loadPrompt = () => {
Expand All @@ -6965,7 +6969,7 @@
}, 10000);
preEle.options.length = 5;
if (locale === "zh") {
fetch("https://cdn.jsdelivr.net/gh/PlexPt/awesome-chatgpt-prompts-zh/prompts-zh.json", {
fetch("https://fastly.jsdelivr.net/gh/PlexPt/awesome-chatgpt-prompts-zh/prompts-zh.json", {
signal: downRoleController.signal
}).then(async (response) => {
let res = await response.json();
Expand All @@ -6979,7 +6983,7 @@
}
}).catch(e => { })
} else {
fetch("https://cdn.jsdelivr.net/gh/f/awesome-chatgpt-prompts/prompts.csv", {
fetch("https://fastly.jsdelivr.net/gh/f/awesome-chatgpt-prompts/prompts.csv", {
signal: downRoleController.signal
}).then(async (response) => {
let res = await response.text();
Expand Down

0 comments on commit dd22b76

Please sign in to comment.