Thanks @jmooring , will give the render hook a try.
Regarding the baseURL- I have multiple sites, like staging and prod and both have different uRLs. Not sure how to add both of those or how to deal with this scenario.
Created config folder and added the respective files. I just have one confusion. For default config, do I add prod URL or local host. Sorry if this is very obvious.
Your default config will be used when running hugo server because you have not created a development directory within the config directory… and that’s fine.
For the _default/config use your production baseURL. This is really important if your production site is served from a subdirectory, e.g.,
Well turned out the issue was not with the what I had done. But with the docker file config. The environments were not configured properly hence the missing images.
But I fixed the base URL as per the suggestions here and learned a lot in the process. Thank you for the help.