Skip to content

Commit

Permalink
web vitals: remove hero image from article page
Browse files Browse the repository at this point in the history
  • Loading branch information
thombergs committed Jan 2, 2024
1 parent f6f5164 commit 600d918
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions themes/geeky/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,6 @@
<div class="container">
<div class="row">
<div class="col-lg-8 mb-5 mb-lg-0">
<!-- image path -->
{{ $imagePath:= .Params.image }}
{{ if $imagePath }}
<!-- image CDN -->
{{ if hasPrefix $imagePath "http" }}
<img loading="eager" decoding="async" src="{{ $imagePath | safeURL }}" alt="{{ .Title }}"
class="img-fluid w-100 rounded-4 mb-4">
{{ else }}
<!-- /image cdn -->

<!-- image processing for multiple device -->
{{ if fileExists (add `assets/` $imagePath) }}
{{ $image:= resources.Get $imagePath }}
{{ $imageFallback:= $image.Resize "1400x" }}
{{ $imageXL:= $image.Resize "1400x webp" }}
{{ $imageLG:= $image.Resize "1000x webp" }}
{{ $imageMD:= $image.Resize "800x webp" }}
{{ $imageSM:= $image.Resize "600x webp" }}
<picture>
<source srcset="{{ $imageSM.RelPermalink }}" media="(max-width: 575px)">
<source srcset="{{ $imageMD.RelPermalink }}" media="(max-width: 767px)">
<source srcset="{{ $imageLG.RelPermalink }}" media="(max-width: 992px)">
<source srcset="{{ $imageXL.RelPermalink }}">
<img loading="eager" decoding="async" class="img-fluid mb-4 w-100 rounded-4"
src="{{$imageFallback.RelPermalink}}" alt="{{.Title}}" width="{{$image.Width}}"
height="{{$image.Height}}">
</picture>
{{ else }}
<strong class="text-danger">`{{$imagePath}}` doesn't exist</strong>
{{ end }}
<!-- /image processing for multiple device -->
{{ end }}
{{ end }}
<h1 class="mb-4 h2">{{.Title | markdownify}}</h1>
<ul class="list-inline d-flex align-items-center mb-4">
<li class="list-inline-item d-flex align-items-center me-4">
Expand Down

0 comments on commit 600d918

Please sign in to comment.