A common issue of AWS AMPLIFY

Hi, I just deploy my web to AWS AMPLIFY, however, it seems like the local resources can not be loaded.

My git repo: GitHub - yinxiangshi/newhp

Web: allonsygamma.com

Can you help me?

Open your browser’s dev tools console and reload the site:

Change your baseURL from:

\

to:

https://www.allonsygamma.com/

And update themes/paige/layouts/_default/home.html:

diff --git a/themes/paige/layouts/_default/home.html b/themes/paige/layouts/_default/home.html
index f485251..81c09fb 100644
--- a/themes/paige/layouts/_default/home.html
+++ b/themes/paige/layouts/_default/home.html
@@ -13,7 +13,7 @@
 {{ end }}
 <div class="row py-3">
     <div class="col">
-      <div class="rounded-4" style="background-image: url('{{ .Site.BaseURL }}/cover.jpg'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
+      <div class="rounded-4" style="background-image: url('{{ "cover.jpg" | absURL }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
     </div>
 </div>
 <div class="d-flex justify-content-center py-3 row">
@@ -24,7 +24,7 @@
                 <p class="lead">{{ .Params.blurb | markdownify }}</p>
             </div>
             <div class="col-12 col-md-6 text-center">
-                <img alt="Avatar" class="img-fluid rounded-4" src="{{ .Site.BaseURL }}/avatar.jpg" style="max-height:20rem">
+                <img alt="Avatar" class="img-fluid rounded-4" src="{{ "avatar.jpg" | absURL }}" style="max-height:20rem">
             </div>
         </div>
     </div>

@jmooring

This actually works! Thanks.

Btw, is the code should be?

url('{{ "cover.jpg" | absURL }}');

Updated.

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