# Resize image from front matter

**URL:** <https://discourse.gohugo.io/t/resize-image-from-front-matter/29890>\
**Category:** support\
**Created:** [December 8, 2020, 3:34pm UTC](https://discourse.gohugo.io/t/resize-image-from-front-matter/29890 "2020-12-08T15:34:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abroudin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/abroudin/32/12881_2.png) [@abroudin](https://discourse.gohugo.io/u/abroudin)\
**Post date:** [December 8, 2020, 3:34pm UTC](https://discourse.gohugo.io/t/resize-image-from-front-matter/29890/1 "2020-12-08T15:34:31Z")

</div>

Hi I’m trying to resize an image from Front matter but can’t manage it

here is my snippet

```auto
{{ if (isset .Params "cover") }}
  <img class="Article-Image Image" src="{{ .Params.cover }}" alt="{{ .Title }}" />
{{ end }}

```

I was trying to do `{{ .Params.cover.Resize "192px" }}`

I have tried to understand how it was done [here](https://discourse.gohugo.io/t/resizing-front-matter-images/18246) , but does not work for me

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 8, 2020, 5:50pm UTC](https://discourse.gohugo.io/t/resize-image-from-front-matter/29890/2 "2020-12-08T17:50:19Z")

</div>

What exactly did you try to do according to [that post](https://discourse.gohugo.io/t/resizing-front-matter-images/18246) that did not work for you?

---

<div class="post-metadata">

**Author:** ![abroudin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/abroudin/32/12881_2.png) [@abroudin](https://discourse.gohugo.io/u/abroudin)\
**Post date:** [December 8, 2020, 5:58pm UTC](https://discourse.gohugo.io/t/resize-image-from-front-matter/29890/3 "2020-12-08T17:58:09Z")

</div>

I have used her solution

```auto
{{ with .Params.image }}
    {{ with ($.Site.GetPage (path.Dir .)).Resources.GetMatch (path.Base .) }}
        {{ $r := .Resize "240x" }}
        <img src="{{ $r.RelPermalink }}">
    {{ end }}
{{ end }}

```

and replace `.Params.image` with `.Params.cover` it looks like this part `{{ with ($.Site.GetPage (path.Dir .)).Resources.GetMatch (path.Base .) }}` does not work when I try to print something in it, I’m working on a `single` page
