title: How to get the image resource permalink in shortcode?
body: <p>I'm trying to create a shortcode where I need to read a resource property. This is my shortcode <code>lbimg.html</code>:</p>
  
  <pre><code>{{ $img := $.Page.Resources.GetMatch (.Get "name")}}
  {{$img.RelPermalink}}
  </code></pre>
  
  <p>This is how I use it:</p>
  
  <pre><code>{{&lt; lbimg name="/images/test.png" &gt;}}
  </code></pre>
  
  <p>This is what I'm getting when building the site:</p>
  
  <blockquote>
    <p>failed to render shortcode "lbimg": failed to process shortcode: "path_to_blog/layouts/shortcodes/lbimg.html:2:6": execute of template failed: template: shortcodes/lbimg.html:2:6: executing "shortcodes/lbimg.html" at : nil pointer evaluating resource.Resource.RelPermalink</p>
  </blockquote>
  
  <p>I don't understand what does that mean, why the resource is <code>nil</code>?</p>
  
  <p>I'm using <code>Hugo 0.59.1</code>.</p>
  
  <p>The content structure is as follows:</p>
  
  <pre><code>blog
  ├── content
  │   └── post
  │       └── test_post
  │           ├── images
  │           │   └── test.png
  │           └── index.md
  └── ...
  </code></pre>