🎨 🐛 Rename file & path & remove unused file.
This commit is contained in:
19
layouts/partials/_funs/get_cdn_res.html
Normal file
19
layouts/partials/_funs/get_cdn_res.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{/* Use to get resources path with vendor */}}
|
||||
|
||||
{{ $fmt := "%s/%s@%s/%s" }}
|
||||
|
||||
{{ $npm := .res.name }}
|
||||
{{ $file := .res.file }}
|
||||
|
||||
{{ if ne .router.type "nodejs" }}
|
||||
{{ $file = replaceRE `(dist|lib|source\/js)\/` "" .res.file }}
|
||||
{{ $fmt = "%s/%s/%s/%s" }}
|
||||
{{ else }}
|
||||
{{ with .res.alias }}
|
||||
{{ $npm = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $pluginRes := printf $fmt .router.url $npm .res.version $file }}
|
||||
|
||||
{{ return $pluginRes }}
|
||||
Reference in New Issue
Block a user