---
title: assetHref
description: >-
  The published URL of an attachment named in a note's frontmatter (`cover:
  hero.jpg`, `image: portrait.svg`); external URLs pass through. Undefined when
  the vault didn't publish it. Resolves like the pipeline, which publishes
  attachments named by top-level `image`, `cover`, and `socialImage`: relative
  to the note's file, then from the vault root, then by a basename only one
  attachment has.
updated_at: '2026-10-04T03:32:25+02:00'
created_at: '2026-09-25T10:30:20+02:00'
symbol:
  kind: function
  name: assetHref
  signatures:
    - >-
      assetHref(vault: { readonly routes: { readonly mountPath: string };
      readonly assets: readonly { readonly path: string }[] }, note: { readonly
      path: string }, name: string): string | undefined
  parameters:
    - name: vault
      type: >-
        { readonly routes: { readonly mountPath: string }; readonly assets:
        readonly { readonly path: string }[] }
    - name: note
      type: '{ readonly path: string }'
    - name: name
      type: string
  returns:
    type: string | undefined
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/packages/ui/src/lib/assets.ts#L8
---

# assetHref
