# resources.GetRemote with front matter unsupported protocol scheme ""

**URL:** <https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990>\
**Category:** support\
**Created:** [May 23, 2024, 1:19pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990 "2024-05-23T13:19:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir\_dev](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@Vladimir\_dev](https://discourse.gohugo.io/u/Vladimir_dev)\
**Post date:** [May 23, 2024, 1:19pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/1 "2024-05-23T13:19:12Z")

</div>

Hello. I have some error.

```auto
+++
mainImg = "https://imgopt.pages.dev/assets/xrpl-grants-crypto-projects_original.jpg"
+++

```

single.html

```auto
{{ $url := "https://imgopt.pages.dev/assets/xrpl-grants-crypto-projects_original.jpg" }}
{{ $url_par := .Params.mainImg }}
{{ with resources.GetRemote $url_par }}
        <img
          class="object-cover"
          src="{{ .Permalink }}"
          alt="{{ .Params.altMainImg }}"
          title="{{ .Params.titleMainImg }}"
          loading="lazy"
          decoding="async"
          {{/* crossorigin="anonymous"
          sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
          srcset="small.jpg 500w, medium.jpg 768w, {{ .RelPermalink }} 1024w" */}}
        />
        {{ end }} 

```

When I use $url with a string, it works fine, but when I use $url\_par, I get an error.

 ![Screenshot (186)](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/d/9/d96813af821bdc61f8a473d809e0630ede34db99.png)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 23, 2024, 1:26pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/2 "2024-05-23T13:26:39Z")

</div>

What is `.Params.mainImg`? Does that value exist on every page?

---

<div class="post-metadata">

**Author:** ![Vladimir\_dev](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@Vladimir\_dev](https://discourse.gohugo.io/u/Vladimir_dev)\
**Post date:** [May 23, 2024, 1:29pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/3 "2024-05-23T13:29:28Z")

</div>

```auto
+++
title = "XRPL Grants Announces Seventh Batch of Selected Projects"
date = 2024-05-22T22:30:34+03:00
draft = false
slug = "xrpl-grants-announces-seventh-batch-of-selected-projects"
tags = ['hot', 'funding', 'grants', 'projects']
[params]  
  sourse = "Binance"
  sourseTitle = "XRPL Grants Announces Seventh Batch of Selected Projects"
  sourseUrl = "https://www.binance.com/en/square/post/2024-05-22-xrpl-grants-announces-seventh-batch-of-selected-projects-8442766091162"
  imgHost = "https://imgopt.pages.dev/assets/"
  mainImg = "https://imgopt.pages.dev/assets/xrpl-grants-crypto-projects_original.jpg"
  altMainImg = "Overview of cryptocurrency projects funded by XRPL Grants"
  titleMainImg = "XRPL Grants Funding Innovative Crypto Projects"
  generatorMainImg = "Bing DALL·E 3"
  aimodel = "Claude 3 Sonnet"
  exclusive = false
  exclusiveRef = ""
+++

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 23, 2024, 1:31pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/4 "2024-05-23T13:31:13Z")

</div>

> [@jmooring](#):
>
> Does that value exist on every page?

So…?

---

<div class="post-metadata">

**Author:** ![Vladimir\_dev](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@Vladimir\_dev](https://discourse.gohugo.io/u/Vladimir_dev)\
**Post date:** [May 23, 2024, 1:51pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/5 "2024-05-23T13:51:44Z")

</div>

Yes. I created new branch, saved and del all content and I have only one post. I changed mainImg with all languages and have an error too

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 23, 2024, 1:53pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/6 "2024-05-23T13:53:23Z")

</div>

I’m pretty sure you missed something. When a page doesn’t have a mainImg param the value is “”, hence the error. Learn to code defensively:

```plaintext

{{ with .Params.mainImg }}
  {{ with resources.GetRemote . }}

  {{ end }}
{{ end }}

```

---

<div class="post-metadata">

**Author:** ![Vladimir\_dev](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@Vladimir\_dev](https://discourse.gohugo.io/u/Vladimir_dev)\
**Post date:** [May 23, 2024, 2:17pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/7 "2024-05-23T14:17:26Z")

</div>

Problem was with empty single.html file in my content when I test theme  
I deleted it and code works fine

 ![Screenshot (189)](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/0/e/0ed0cea4bee758cd445d533a2887253f08e2a653.jpeg)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 23, 2024, 2:18pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/8 "2024-05-23T14:18:21Z")

</div>

Regardless, code defensively.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 25, 2024, 2:18pm UTC](https://discourse.gohugo.io/t/resources-getremote-with-front-matter-unsupported-protocol-scheme/49990/9 "2024-05-25T14:18:42Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
