Skip to content

Commit

Permalink
refactor: profile
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed May 23, 2024
1 parent 121b561 commit dfa18cd
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions layouts/partials/home/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@
{{- if $avatar -}}
<div class="home-avatar">
{{- $menus := $.Site.Menus.main | default slice -}}
{{- $optim := slice
(dict "Process" "fill center 96x96 webp q75" "descriptor" "800w")
(dict "Process" "fill center 144x144 webp q75" "descriptor" "1200w")
(dict "Process" "fill center 192x192 webp q75" "descriptor" "1600w")
-}}
{{- with index $menus 0 -}}
{{- $url := .URL | relLangURL -}}
{{- with .Page -}}
{{- $url = .RelPermalink -}}
{{- end -}}
{{- with $profile.avatarLinkURL -}}
{{- $url = . -}}
{{- end -}}
<a href="{{ $url }}" {{ with .Title | default .Name }} title="{{ . }}" {{ end }}{{ if (urls.Parse $url).Host }}
rel="noopener noreferrer" target="_blank" {{ end }}>
{{- dict "Src" $avatar "Height" "100" "Width" "100" "Loading" "eager" | partial "plugin/image.html" -}}
</a>
{{- $url := .URL | relLangURL -}}
{{- with .Page -}}
{{- $url = .RelPermalink -}}
{{- end -}}
{{- with $profile.avatarLinkURL -}}
{{- $url = . -}}
{{- end -}}
<a href="{{ $url }}" {{ with .Title | default .Name }} title="{{ . }}" {{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank" {{ end }}>
{{- dict "Src" $avatar "Height" "100" "Width" "100" "Loading" "eager" "Optim" $optim | partial "plugin/image.html" -}}
</a>
{{- else -}}
{{- dict "Src" $avatar "Height" "100" "Width" "100" | partial "plugin/image.html" -}}
{{- dict "Src" $avatar "Height" "100" "Width" "100" "Loading" "eager" "Optim" $optim | partial "plugin/image.html" -}}
{{- end -}}
</div>
{{- end -}}
Expand Down

0 comments on commit dfa18cd

Please sign in to comment.