Concrete
GuidesOrganize and ship

Ship a static asset

The design calls for an image, a mark or a document the template owns — not one a property uploads — and you need it in the bundle.

Goal

Put a file the template itself owns into the artifact, and reach it from markup or from CSS.

A template-shipped asset is the design's, not the property's. A photograph of this building is a slot; the divider rule under every heading is an asset.

Prerequisites

The workspace from Start. If what you are reaching for is a value that differs per property, you want a slot instead — Slots draws the line.

Steps

1. Put the file in the workspace and import it

There is no assets directory to register and no manifest to update. Import the file from the module that uses it, and the build follows the import.

sections/hero/section.tsx
import { Section } from "@homepages/concrete";

import crest from "./crest.svg";

export const Mark = () => (
  <Section>
    <img src={crest} alt="" className="h-8 w-auto" />
  </Section>
);

2. Know which of the two lanes your file is in

A raster image imported from JavaScript is derived at build time into the same responsive ladder a property's uploaded photo gets, and the import yields an AuthorImage object rather than a string. .png, .jpg, .jpeg, .webp and .avif take that lane.

Everything else is byte passthrough, and the import yields the built URL string: .svg, .ico and .gif (rasterising line art is a regression, and a ladder cannot express an animation), the font formats, .mp4 and its siblings, .pdf, .zip.

sections/hero/section.tsx
import { fact, fill, Image, Section, section, Slot, text } from "@homepages/concrete";

import badge from "./badge.png";
import crest from "./crest.svg";

const BRIEF = fill.write({
  reads: [fact.property.description],
  brief: "Name what makes the property worth seeing. Write one sentence. Confident and short.",
});

export const Hero = section(
  { key: "hero", label: "Hero", slots: { headline: text.medium({ label: "Headline", cap: 80, source: BRIEF }) } },
  ({ slot }) => (
    <Section>
      <img src={crest} alt="" className="h-8 w-auto" />
      <Slot.Text slot={slot.headline} as="h1" />
      <Image value={badge} alt="Certified historic" className="w-24" />
    </Section>
  ),
);

<Image> is what serves the ladder, and alt is required for a shipped asset: an AuthorImage carries none of its own, because nobody typed one into an editor. A decorative mark takes alt="" on a plain <img> and is done. An element that renders with no source at all is render/broken-image.

3. Reach an asset from CSS the same way

A url() is resolved against the stylesheet that wrote it and content-hashed into the template's assets, so a relative path survives being inlined:

sections/hero.css
.hero-grain {
  background-image: url("./grain.png");
}

4. Never point at a URL you do not ship

sections/hero.css
/* Don't: the download worker's page reaches nothing but its own bundle. */
.hero-grain {
  background-image: url("https://cdn.example.com/grain.png");
}

A rendered format — a deck, a social post, a print sheet — is captured offline, so its compiled stylesheet may reference no external URL: css/external-url, reported against the compiled output. A website is not refused there and still pays a round trip on every visit.

Verify

Run concrete dev and confirm the asset paints in the playground; a 404 in the browser console is almost always an import that resolved to a path rather than a module. Then run concrete check — the stylesheet stage grades every url() (css/compile-failed for one that cannot resolve) and the render stage grades every image element. concrete check also prints each placed section's asset weights, which is where a 4 MB background announces itself.

On this page