💄 optimization CDN vendors display & import generate site speed.

This commit is contained in:
凡梦星尘 2022-06-21 09:19:12 +08:00
parent c116aa31ad
commit 9a83558e01
8 changed files with 67 additions and 42 deletions

8
.gitignore vendored
View File

@ -1,6 +1,6 @@
# Ignore files in Hugo NexT theme # Ignore files in Hugo NexT theme
.hugo_build.lock exampleSite/
!exampleSite/content
exampleSite/public !exampleSite/start.sh
exampleSite/resources !exampleSite/config.yaml

View File

@ -12,5 +12,5 @@ Make `NexT` theme is easily & powerful.
| Environment | :gemini: (**Default**) | :heart_decoration: | :six_pointed_star: | :pisces: | Status | | Environment | :gemini: (**Default**) | :heart_decoration: | :six_pointed_star: | :pisces: | Status |
| :---: | :---: | :---: | :---: | :---: | :---: | | :---: | :---: | :---: | :---: | :---: | :---: |
| Preliminary | [Gemini](https://hugo-next-dev.vercel.app/) | [Muse](https://hugo-next-dev.vercel.app/muse/) | [Mist](https://hugo-next-dev.vercel.app/mist/) | [Pisces](https://hugo-next-dev.vercel.app/pisces/) | ![Vercel](https://therealsujitk-vercel-badge.vercel.app/?app=hugo-next-dev&style=for-the-badge) | | Preliminary | [Gemini](https://preview.hugo-next.eu.org/) | [Muse](https://preview.hugo-next.eu.org/muse/) | [Mist](https://preview.hugo-next.eu.org/mist/) | [Pisces](https://preview.hugo-next.eu.org/pisces/) | ![Vercel](https://therealsujitk-vercel-badge.vercel.app/?app=hugo-next&style=for-the-badge) |
| Production | [Gemini](https://hugo-next-prod.vercel.app/) | [Muse](https://hugo-next-prod.vercel.app/muse/) | [Mist](https://hugo-next-prod.vercel.app/mist/) | [Pisces](https://hugo-next-prod.vercel.app/pisces/) | ![Vercel](https://therealsujitk-vercel-badge.vercel.app/?app=hugo-next-prod&style=for-the-badge) | | Production | [Gemini](https://hugo-next.eu.org/) | [Muse](https://hugo-next.eu.org/muse/) | [Mist](https://hugo-next.eu.org/mist/) | [Pisces](https://hugo-next.eu.org/pisces/) | ![Vercel](https://therealsujitk-vercel-badge.vercel.app/?app=hugo-next&style=for-the-badge) |

View File

@ -38,6 +38,19 @@
img { img {
display: inline-block; display: inline-block;
} }
$footer_vendors_imgs_len: length($footer_vendors_imgs_width);
@if ($footer_vendors_imgs_len>0) {
@for $i from 1 through $footer_vendors_imgs_len {
a:nth-child(#{$i}) img {
width: #{nth($footer_vendors_imgs_width, $i)}px;
@include mobile() {
width: #{nth($footer_vendors_imgs_width, $i)-10}px;
}
}
}
}
} }
} }
} }
@ -48,24 +61,6 @@
} }
} }
@keyframes icon-animate {
0%, 100% {
transform: scale(1);
}
10%, 30% {
transform: scale(.9);
}
20%, 40%, 60%, 80% {
transform: scale(1.1);
}
50%, 70% {
transform: scale(1.1);
}
}
.languages { .languages {
display: inline-block; display: inline-block;
font-size: $font-size-large; font-size: $font-size-large;
@ -91,7 +86,7 @@
margin: 0 5px; margin: 0 5px;
@if $footer_icon_animated { @if $footer_icon_animated {
animation: icon-animate 1.33s ease-in-out infinite; animation: beat 1.33s ease-in-out infinite;
} }
} }

View File

@ -0,0 +1,17 @@
@keyframes beat {
0%, 100% {
transform: scale(1);
}
10%, 30% {
transform: scale(.9);
}
20%, 40%, 60%, 80% {
transform: scale(1.1);
}
50%, 70% {
transform: scale(1.1);
}
}

View File

@ -1,2 +1,3 @@
@import 'icon';
@import 'show'; @import 'show';
@import 'hover'; @import 'hover';

View File

@ -23,6 +23,15 @@ $footer_icon_color : {{ $P.footer.icon.color }};
$footer_icon_animated : {{ $P.footer.icon.animated }}; $footer_icon_animated : {{ $P.footer.icon.animated }};
$footer_beian_enable : {{ $P.footer.beian.enable }}; $footer_beian_enable : {{ $P.footer.beian.enable }};
$footer_vendors_enable : {{ isset $P.footer "vendors" }}; $footer_vendors_enable : {{ isset $P.footer "vendors" }};
{{ with $P.footer.vendors }}
{{ $width := slice "start" }}
{{ range .list }}
{{ if .image }}
{{ $width = $width | append .image.width }}
{{ end }}
{{ end }}
{{ printf "$footer_vendors_imgs_width:%s;" (delimit (after 1 $width) ", ") }}
{{ end }}
// Counter // Counter
$busuanzi_enable : {{ $P.busuanzi.enable }}; $busuanzi_enable : {{ $P.busuanzi.enable }};

View File

@ -354,14 +354,18 @@ params:
vendors: vendors:
title: 提供CDN/云资源支持 title: 提供CDN/云资源支持
list: list:
- name: Webify
link: https://webify.cloudbase.net
- name: Vercel - name: Vercel
img: /imgs/vendors/vercel.svg || 55 image:
url: /imgs/vendors/vercel.svg
width: 50
link: https://vercel.com link: https://vercel.com
- name: 又拍云 - name: 又拍云
img: /imgs/vendors/upyun.png || 50 image:
url: /imgs/vendors/upyun.png
width: 43
link: https://upyun.com link: https://upyun.com
- name: Webify
link: https://webify.cloudbase.net
# --------------------------------------------------------------- # ---------------------------------------------------------------
@ -711,7 +715,7 @@ params:
#style: tabs #style: tabs
# Choose a comment system to be displayed by default. # Choose a comment system to be displayed by default.
# Available values: disqus | disqusjs | changyan | livere | gitalk | utterances # Available values: disqus | disqusjs | changyan | livere | gitalk | utterances
active: waline active: utterances
# Setting `true` means remembering the comment system selected by the visitor. # Setting `true` means remembering the comment system selected by the visitor.
storage: true storage: true
# Lazyload all comment systems. # Lazyload all comment systems.
@ -721,11 +725,11 @@ params:
- name: Waline - name: Waline
title: Waline title: Waline
color: "#27ae60" color: "#27ae60"
weight: 1
- name: Utterances
title: Utters
color: "#494949"
weight: 2 weight: 2
- name: Utterances
title: Utteranc
color: "#886ce4"
weight: 1
waline: waline:
enable: true enable: true
@ -734,7 +738,7 @@ params:
imgUploader: false imgUploader: false
wordLimit: 200 wordLimit: 200
requiredMeta: ['nick', 'mail'] requiredMeta: ['nick', 'mail']
serverURL: "https://waline.js.org" serverURL: #<your waline server url>
# Disqus # Disqus
# For more information: https://disqus.com # For more information: https://disqus.com
@ -766,7 +770,7 @@ params:
# You can get your uid from https://livere.com/insight/myCode (General web site) # You can get your uid from https://livere.com/insight/myCode (General web site)
livere: livere:
enable: true enable: true
uid: MTAyMC81MTM4MC8yNzg2MQ== # <your_uid> uid: # <your_uid>
# Gitalk # Gitalk
# For more information: https://gitalk.github.io # For more information: https://gitalk.github.io
@ -792,9 +796,9 @@ params:
repo: username/repo-name # Github repository owner and name repo: username/repo-name # Github repository owner and name
# Available values: pathname | url | title | og:title # Available values: pathname | url | title | og:title
issueTerm: pathname issueTerm: pathname
label: Comments label:
# Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light # Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light
theme: github-light theme: preferred-color-scheme
# Isso # Isso
# For more information: https://posativ.org/isso/ # For more information: https://posativ.org/isso/

View File

@ -93,9 +93,8 @@
<div class="vendors-list"> <div class="vendors-list">
{{- range .list }} {{- range .list }}
<a target="_blank" href="{{ .link }}" title="{{ .name }}"> <a target="_blank" href="{{ .link }}" title="{{ .name }}">
{{- if .img }} {{- if .image }}
{{ $img := split .img "||" }} <img src="{{ .image.url }}" alt="{{ .name }}" />
<img src="{{- trim (index $img 0) " " }}" width="{{- trim (index $img 1) " " -}}px" alt="{{ .name }}" />
{{- else }} {{- else }}
{{ .name }} {{ .name }}
{{- end }} {{- end }}