Assets

Images, Fonts, And URLs

Put local theme files in resources/assets, then reference them with normal paths in your templates and CSS.

Images In Templates#

Use the image path directly:

phpresources/views/front-page.php
<img src="logo.svg" alt="Site logo"><img src="/sample/picture.jpg" alt="Sample image">

logo.svg maps to resources/assets/logo.svg.

/sample/picture.jpg maps to resources/assets/sample/picture.jpg.

URLs In CSS#

Inside CSS, local url() paths can point to files in resources/assets:

cssresources/css/main.css
.logo {  background-image: url("logo.svg");}.card {  background-image: url("/sample/picture.jpg");}

Both paths resolve from resources/assets, even when the CSS file is in a nested folder.

Fonts#

Fonts can live in resources/assets/fonts:

cssresources/css/main.css
@font-face {  font-family: "Brand";  src: url("fonts/brand.woff2") format("woff2");  font-display: swap;}

The source path stays readable, and the built theme receives the correct published asset URL.