Skip to content

Commit

Permalink
perf: remove redundant if conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jan 20, 2023
1 parent f964ccd commit 992e3ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/head/favicons.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{- if fileExists $filepath }}
{{- $file := readFile $filepath }}
<link rel="{{ $rel }}" href="{{ printf "/images/icons/%s" $filename | absURL }}?version={{ $file | md5 }}" sizes="{{ .size }}">
{{- else if $favicon }}
{{- else }}
{{- $img := $favicon.Resize .size }}
<link rel="{{ $rel }}" href="{{ $img.RelPermalink }}" sizes="{{ .size }}" type="{{ $img.MediaType }}">
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/pwa/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{- $filename := printf "images/icons/icon-%s.png" . -}}
{{- if fileExists (path.Join "static" $filename) -}}
{{- $icons = $icons | append (dict "src" ($filename | absURL) "sizes" .) -}}
{{- else if $favicon }}
{{- else }}
{{- $icons = $icons | append (dict "src" ($favicon.Resize .).RelPermalink "sizes" .) -}}
{{- end -}}
{{- end -}}
Expand Down

0 comments on commit 992e3ec

Please sign in to comment.