Resource System

2025-01-02

You can load HTML files from the resource system using the following URL:

res://godot/path/file.html

In this URL, godot is considered the "host" and should always be present. The web path in this case is /path/file.html which translates to res://path/file.html in the Godot resource system.

File extensions

By default, Godot's filesystem panel will not show .html files. You can change that in the editor options:

editor_filesystem_html_jinja.png

We suggest adding both html and jinja

From HTML

To refer to Godot resources from HTML, the godot (host) part is not needed, as it is implied when you're already browsing that host. You can simply have an img tag as follows:

<img src="/path/image.jpg"/>

This would look for res://path/image.jpg in your Godot project.

Additional information

  1. Mimetype is automatically assigned based on the file extension, see the list here
  2. URLs ending with / will cause this addon to load index.html from that path
  3. Try to keep file sizes reasonable