<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Performance on OKCKnet</title><link>/tags/performance/</link><description>Recent content in Performance on OKCKnet</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 27 Apr 2026 01:24:31 +0300</lastBuildDate><atom:link href="/tags/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>Hugo: Dynamic Image Rendering with URL Replacement</title><link>/blog/work/hugo-dynamic-image-rendering-with-url-replacement/</link><pubDate>Mon, 16 Oct 2023 07:40:00 +0300</pubDate><guid>/blog/work/hugo-dynamic-image-rendering-with-url-replacement/</guid><description>&lt;p&gt;If you want to use Hugo to dynamically render images with URL replacement and lazy loading, here is the code.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-javascript"&gt;{{ $card__show_image := .Params.show_image }}
{{ $cardImageURL := &amp;quot;&amp;quot; }}
{{ if and (eq $card__show_image &amp;quot;true&amp;quot;) (.Params.images) }}
 {{ with .Params.images }}
 {{ range $image := . | first 1 }}
 {{ $cardImageURL = replaceRE &amp;quot;(=w|s)(2400|1600)&amp;quot; &amp;quot;$1360&amp;quot; $image }}
 {{ end }}
 {{ end }}
 &amp;lt;img src=&amp;quot;{{ $cardImageURL | absURL }}&amp;quot; alt=&amp;quot;{{ .LinkTitle }}&amp;quot; decoding=&amp;quot;async&amp;quot; loading=&amp;quot;lazy&amp;quot;&amp;gt;
{{ end }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;rsquo;m using this code on my blog to render images with lazy loading and responsive image sizes on different part of my blog, like cards, cover images etc.&lt;/p&gt;</description></item></channel></rss>