mirror of
https://github.com/dillonzq/LoveIt.git
synced 2025-04-26 21:56:19 +02:00
feat(resource): refactor resources structure (#935)
This commit is contained in:
parent
b2c9e1091d
commit
4c5fdf7856
78 changed files with 24 additions and 2 deletions
assets/lib
fontawesome-free/webfonts
fa-brands-400.ttffa-brands-400.woff2fa-regular-400.ttffa-regular-400.woff2fa-solid-900.ttffa-solid-900.woff2fa-v4compatibility.ttffa-v4compatibility.woff2
katex/fonts
KaTeX_AMS-Regular.ttfKaTeX_AMS-Regular.woffKaTeX_AMS-Regular.woff2KaTeX_Caligraphic-Bold.ttfKaTeX_Caligraphic-Bold.woffKaTeX_Caligraphic-Bold.woff2KaTeX_Caligraphic-Regular.ttfKaTeX_Caligraphic-Regular.woffKaTeX_Caligraphic-Regular.woff2KaTeX_Fraktur-Bold.ttfKaTeX_Fraktur-Bold.woffKaTeX_Fraktur-Bold.woff2KaTeX_Fraktur-Regular.ttfKaTeX_Fraktur-Regular.woffKaTeX_Fraktur-Regular.woff2KaTeX_Main-Bold.ttfKaTeX_Main-Bold.woffKaTeX_Main-Bold.woff2KaTeX_Main-BoldItalic.ttfKaTeX_Main-BoldItalic.woffKaTeX_Main-BoldItalic.woff2KaTeX_Main-Italic.ttfKaTeX_Main-Italic.woffKaTeX_Main-Italic.woff2KaTeX_Main-Regular.ttfKaTeX_Main-Regular.woffKaTeX_Main-Regular.woff2KaTeX_Math-BoldItalic.ttfKaTeX_Math-BoldItalic.woffKaTeX_Math-BoldItalic.woff2KaTeX_Math-Italic.ttfKaTeX_Math-Italic.woffKaTeX_Math-Italic.woff2KaTeX_SansSerif-Bold.ttfKaTeX_SansSerif-Bold.woffKaTeX_SansSerif-Bold.woff2KaTeX_SansSerif-Italic.ttfKaTeX_SansSerif-Italic.woffKaTeX_SansSerif-Italic.woff2KaTeX_SansSerif-Regular.ttfKaTeX_SansSerif-Regular.woffKaTeX_SansSerif-Regular.woff2KaTeX_Script-Regular.ttfKaTeX_Script-Regular.woffKaTeX_Script-Regular.woff2KaTeX_Size1-Regular.ttfKaTeX_Size1-Regular.woffKaTeX_Size1-Regular.woff2KaTeX_Size2-Regular.ttfKaTeX_Size2-Regular.woffKaTeX_Size2-Regular.woff2KaTeX_Size3-Regular.ttfKaTeX_Size3-Regular.woffKaTeX_Size3-Regular.woff2KaTeX_Size4-Regular.ttfKaTeX_Size4-Regular.woffKaTeX_Size4-Regular.woff2KaTeX_Typewriter-Regular.ttfKaTeX_Typewriter-Regular.woffKaTeX_Typewriter-Regular.woff2
lightgallery/fonts
layouts/partials
package.jsonstatic/lib/images
Before (image error) Size: 12 KiB After (image error) Size: 12 KiB |
|
@ -45,6 +45,12 @@
|
|||
{{- if $params.lightgallery -}}
|
||||
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/css/lightgallery-bundle.min.css" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- if not $cdn.lightgalleryCSS -}}
|
||||
{{- (resources.Get "lib/lightgallery/images/loading.gif").Publish -}}
|
||||
{{- range resources.Match "lib/lightgallery/fonts/*" -}}
|
||||
{{- .Publish -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/plugins/thumbnail/lg-thumbnail.min.js" -}}
|
||||
|
@ -52,7 +58,6 @@
|
|||
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $config = dict "lightgallery" true | merge $config -}}
|
||||
{{- $_ := (resources.Get "lib/lightgallery/images/loading.gif").RelPermalink -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* clipboard.js */ -}}
|
||||
|
@ -85,6 +90,11 @@
|
|||
{{- if $math.enable -}}
|
||||
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- if not $cdn.katexCSS -}}
|
||||
{{- range resources.Match "lib/katex/fonts/*" -}}
|
||||
{{- .Publish -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $source := $cdn.katexJS | default "lib/katex/katex.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $source := $cdn.katexAutoRenderJS | default "lib/katex/contrib/auto-render.min.js" -}}
|
||||
|
@ -120,7 +130,6 @@
|
|||
{{- if (.Scratch.Get "this").mermaid -}}
|
||||
{{- $source := $cdn.mermaidJS | default "lib/mermaid/mermaid.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $_ := (resources.Get "lib/mermaid/mermaid.min.js.map").RelPermalink -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* ECharts */ -}}
|
||||
|
|
|
@ -39,6 +39,11 @@
|
|||
{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/css/all.min.css" -}}
|
||||
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
|
||||
{{- partial "plugin/style.html" $options -}}
|
||||
{{- if not $cdn.fontawesomeFreeCSS -}}
|
||||
{{- range resources.Match "lib/fontawesome-free/webfonts/*" -}}
|
||||
{{- .Publish -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Animate.css */ -}}
|
||||
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
{{- $integrity := .Integrity -}}
|
||||
{{- if (urls.Parse $src).Host | not -}}
|
||||
{{- $resource := resources.Get $src -}}
|
||||
{{- with printf `%v.map` $src | resources.Get -}}
|
||||
{{- .Publish -}}
|
||||
{{- end -}}
|
||||
{{- with .Template -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
{{- $resource := 0 -}}
|
||||
{{- if $href | and (not (urls.Parse $href).Host) -}}
|
||||
{{- $resource = resources.Get $href -}}
|
||||
{{- with printf `%v.map` $href | resources.Get -}}
|
||||
{{- .Publish -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with .Content -}}
|
||||
{{- $resource = resources.FromString $.Path . -}}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
"compile": "npx babel src/js --out-file assets/js/theme.js",
|
||||
"compile-lunr-segmentit": "browserify src/lib/lunr/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env",
|
||||
"hugo": "hugo --source exampleSite --buildDrafts --gc",
|
||||
"hugo-development": "hugo --source exampleSite --buildDrafts --gc --minify --environment development",
|
||||
"hugo-production": "hugo --source exampleSite --gc --minify --environment production",
|
||||
"hugo-server": "hugo server --source exampleSite --buildDrafts --disableFastRender",
|
||||
"hugo-server-development": "hugo server --source exampleSite --buildDrafts --disableFastRender --environment development",
|
||||
"hugo-server-production": "hugo server --source exampleSite --minify --disableFastRender --environment production",
|
||||
"htmlproofer": "htmlproofer exampleSite/public --disable-external true --ignore-missing-alt true",
|
||||
"copy-resources": "cp -rf exampleSite/resources ."
|
||||
|
|
Binary file not shown.
Before ![]() (image error) Size: 4.1 KiB |
Loading…
Add table
Reference in a new issue