monal-im / monal-im.org

Hugo Website
MIT License
4 stars 1 forks source link

Fix remote image loading/caching #61

Closed tmolitor-stud-tu closed 2 months ago

tmolitor-stud-tu commented 3 months ago

@wiseweb-works Could you please fix my commit over here: https://github.com/monal-im/monal-im.org/commit/a74061e08bd5923ab1d835a89a1eddbb72f3ac50

I want the image to be fetched when building the hugo website and served from our webserver after build. But somehow it doesn't work the way I want it to, but my hugo skills are too limited to fix that in a reasonable amount of time.

The commit is just an experiment, feel free to change everything if there is a better approach than that :)

Thanks!!

wiseweb-works commented 3 months ago

I got a notification via E-mail. I will check. 👍🏻

Edit: I have the solution, but I need to ask for more clarity. Even if the svg file is updated in the external source, we will only have the old copy and we will actually pull this file from the outside only at the time of build, right?

Will we use the {{< remoteImage >}} shortcode only for this svg file or will we also use it for other files as well? If it is only for this svg, I can hard code the external image address. Or we can use it with something like src=Image_URL again like other shortcodes, even though we only use it for this file @tmolitor-stud-tu

Edit2:

Case-1 (IsNamedParams) usage: {{< remoteImage "weblate.svg" >}} if-params

Case-2 {{ else }} usage: {{< remoteImage "URL" >}} not-params