cdn.pug 2.1 KB
Newer Older
1 2 3 4 5 6 7
//- Reset `window.Promise` when it was not a function.
//- IE refers the element whose id is `Promise` as `window.Promise`, this causes Velocity throwing an exception
script.
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }

8 9 10 11 12 13
- var jquery_js = "https://cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js"
- var velocity_js = "https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js"
- var velocity_ui_js = "https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js"
- if (theme.cdn.jquery) jquery_js = theme.cdn.jquery
- if (theme.cdn.velocity) velocity_js = theme.cdn.velocity
- if (theme.cdn.velocity_ui) velocity_ui_js = theme.cdn.velocity_ui
14

15 16 17
script(src=jquery_js)
script(src=velocity_js)
script(src=velocity_ui_js)
EvanOne(文一)'s avatar
EvanOne(文一) 已提交
18

19
if theme.canvas_ribbon && theme.canvas_ribbon.enable
20 21 22 23
  - var ribbon_js = "https://cdn.jsdelivr.net/npm/ribbon.js@latest/dist/ribbon.min.js"
  - var ribbon = theme.canvas_ribbon
  - if (theme.cdn.canvas_ribbon) ribbon_js = theme.cdn.canvas_ribbon
  script(src=ribbon_js size=ribbon.size alpha=ribbon.alpha zIndex=ribbon.zIndex)
24 25

if theme.canvas_nest && theme.canvas_nest.enable
26
  - var nest_js = "https://cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-nest@latest/canvas-nest.min.js"
EvanOne(文一)'s avatar
EvanOne(文一) 已提交
27
  - var nest = theme.canvas_nest;
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  - if (theme.cdn.canvas_nest) nest_js = theme.cdn.canvas_nest
  script(src=nest_js color=nest.color opacity=nest.opacity count=nest.count zIndex=nest.zIndex)

if theme.fancybox
  - var fancybox_js = "https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"
  - if (theme.cdn.fancybox_js) fancybox_js = theme.cdn.fancybox_js
  script(src=fancybox_js)

if theme.gallery_waterfall && theme.gallery_waterfall.enable
  - var masonry_js = "https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js"
  - if (theme.cdn.masonry) masonry_js = theme.cdn.masonry
  script(src=masonry_js)

if theme.lazyload && theme.lazyload.enable
  - var lazyload_js = "https://cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.min.js"
  - if (theme.cdn.lazyload) lazyload_js = theme.cdn.lazyload
  script(src=lazyload_js)