🎨 Add local resources to support the 3rd js & css.

This commit is contained in:
elkan1788 2024-07-21 11:33:10 +08:00
parent c5c1f03557
commit c07ff1df05
30 changed files with 2147 additions and 7 deletions

View File

@ -55,6 +55,7 @@ js:
- name: animejs
version: 3.2.2
file: lib/anime.min.js
- name: viewerjs
version: 1.11.6
file: dist/viewer.min.js
@ -66,9 +67,11 @@ css:
version: 6.6.0
file: css/all.min.css
alias: font-awesome
- name: animate.css
version: 4.1.1
file: animate.min.css
- name: viewerjs
version: 1.11.6
file: dist/viewer.min.css
@ -98,6 +101,7 @@ waline:
version: 2.15.8
file: dist/waline.js
alias: waline
css:
name: '@waline/client'
version: 2.15.8
@ -108,11 +112,12 @@ artalk:
js:
name: artalk
version: 2.6.4
file: dist/Artalk.js
file: dist/Artalk.min.js
css:
name: artalk
version: 2.6.4
file: dist/Artalk.css
file: dist/Artalk.min.css
giscus:
js: https://giscus.app/client.js
@ -129,6 +134,7 @@ algolia:
name: algoliasearch
version: 4.24.0
file: dist/algoliasearch.umd.min.js
instant:
name: instantsearch.js
version: 4.73.2
@ -141,19 +147,23 @@ plugins:
name: mathjax
version: 3.2.2
file: es5/tex-mml-chtml.min.js
katex:
js:
- name: katex
version: 0.16.11
file: dist/katex.min.js
- name: auto-render
alias_name: katex
version: 0.16.11
file: dist/contrib/auto-render.min.js
css:
name: katex
version: 0.16.11
file: dist/katex.min.css
# 画图渲染
mermaid:
js:
@ -168,6 +178,7 @@ plugins:
version: 2.15.8
file: dist/pageview.js
alias: waline
- name: comment
alias_name: '@waline/client'
version: 2.15.8

View File

@ -38,7 +38,7 @@
</main>
<footer class="footer">
<div class="footer-inner">
{{ partial "footer.html" . }}
{{ partialCached "footer.html" . }}
</div>
</footer>

View File

@ -52,9 +52,11 @@
</a>
{{ end }}
{{ $cv := $.Scratch.Get "router" }}
{{ if and $cv (ne $cv.name "local") }}
<a target="_blank" href="{{ $cv.home }}" title="{{ $cv.name }}">
<img src="/imgs/img-lazy-loading.gif" data-src="{{ $cv.logo }}" alt="{{ $cv.name }}" />
</a>
{{ end }}
<span>{{ .title }}</span>
</div>
{{ end }}

View File

@ -22,12 +22,18 @@
{{ $vendor := .Site.Params.vendors.plugins }}
{{ $router := dict }}
{{ range .Site.Data.resources.vendors }}
{{ if eq .name $vendor }}
{{ $router = . }}
{{ break }}
{{ if eq $vendor "local" }}
{{ $router = dict "url" (printf "%s3rd" .Site.BaseURL) "name" $vendor "type" "modern" }}
{{ else }}
{{ range .Site.Data.resources.vendors }}
{{ if eq .name $vendor }}
{{ $router = . }}
{{ break }}
{{ end }}
{{ end }}
{{ end }}
{{ $globalVars.Set "vendor" $vendor }}
{{ $globalVars.Set "router" $router }}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
static/3rd/animejs/3.2.2/anime.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
static/3rd/artalk/2.6.4/Artalk.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));

File diff suppressed because one or more lines are too long

1
static/3rd/katex/0.16.11/katex.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2029
static/3rd/mermaid/10.9.1/mermaid.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(e,t){"function"==typeof define&&define.amd?define("Waline",["exports"],t):"undefined"!=typeof exports?t(exports):(t(t={}),e.Waline=t)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.commentCount=void 0;const c=e=>{e=function(e){return(0<arguments.length&&void 0!==e?e:"").replace(/\/$/u,"")}(e);return/^(https?:)?\/\//.test(e)?e:"https://"+e},n=e=>{"AbortError"!==e.name&&console.error(e.message)};e.version="2.15.8",e.commentCount=e=>{let{serverURL:r,path:a=window.location.pathname,selector:t=".waline-comment-count",lang:i=navigator.language}=e;const l=new AbortController,s=document.querySelectorAll(t);return s.length&&(()=>{let{serverURL:e,lang:t,paths:n,signal:o}={serverURL:c(r),paths:Array.from(s).map(e=>(e=>{try{e=decodeURI(e)}catch(e){}return e})(e.dataset.path||e.getAttribute("id")||a)),lang:i,signal:l.signal};return fetch(`${e}/comment?type=count&url=${encodeURIComponent(n.join(","))}&lang=`+t,{signal:o}).then(e=>e.json()).then(e=>Array.isArray(e)?e:[e])})().then(n=>{s.forEach((e,t)=>{e.innerText=n[t].toString()})}).catch(n),l.abort.bind(l)}});

View File

@ -0,0 +1,8 @@
/**
* Skipped minification because the original files appears to be already minified.
* Original file: /npm/@waline/client@2.15.8/dist/pageview.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(e,t){if("function"==typeof define&&define.amd)define("Waline",["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var n={exports:{}};t(n.exports),e.Waline=n.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.pageviewCount=void 0;const t={"Content-Type":"application/json"},n=e=>(e=>{let{serverURL:n,lang:r,path:o,type:a,action:i}=e;return fetch(`${n}/article?lang=${r}`,{method:"POST",headers:t,body:JSON.stringify({path:o,type:a,action:i})}).then((e=>e.json()))})({...e,type:"time",action:"inc"}),r=e=>{const t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/\/$/u,"")}(e);return/^(https?:)?\/\//.test(t)?t:`https://${t}`},o=e=>{"AbortError"!==e.name&&console.error(e.message)},a=e=>e.dataset.path||e.getAttribute("id"),i=(e,t)=>{t.forEach(((t,n)=>{t.innerText=e[n].toString()}))};e.pageviewCount=e=>{let{serverURL:t,path:l=window.location.pathname,selector:s=".waline-pageview-count",update:p=!0,lang:c=navigator.language}=e;const g=new AbortController,h=Array.from(document.querySelectorAll(s)),f=e=>{const t=a(e);return null!==t&&l!==t},u=e=>(e=>{let{serverURL:t,lang:n,paths:r,signal:o}=e;return(e=>{let{serverURL:t,lang:n,paths:r,type:o,signal:a}=e;return fetch(`${t}/article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(o.join(","))}&lang=${n}`,{signal:a}).then((e=>e.json()))})({serverURL:t,lang:n,paths:r,type:["time"],signal:o}).then((e=>Array.isArray(e)?e:[e]))})({serverURL:r(t),paths:e.map((e=>a(e)||l)),lang:c,signal:g.signal}).then((t=>i(t,e))).catch(o);if(p){const e=h.filter((e=>!f(e))),o=h.filter(f);n({serverURL:r(t),path:l,lang:c}).then((t=>i(new Array(e.length).fill(t),e))),o.length&&u(o)}else u(h);return g.abort.bind(g)},e.version="2.15.8"}));
//# sourceMappingURL=pageview.js.map

File diff suppressed because one or more lines are too long

11
static/3rd/waline/2.15.8/waline.min.js vendored Normal file

File diff suppressed because one or more lines are too long