Skip to main content

Hardcoding Images

To hardcode images into your site using Twig and Timber, you can use the following code snippet:

<img src="{{ theme.link }}/static/images/my-image.jpg" alt="My Image">

This code will display an image with the file name my-image.jpg located in the static/images directory within your theme. The theme.link variable returns the URL of the theme directory, so you can use it to reference the location of the image file.