SEP 49: Handler for asset referencing

With SEP 48: Remove assets from notes directory on the road map I still want to preserve the ability to build the site fully locally with asset preview etc.

The way forward I see here is in the use of an asset manifest that tracks all referenced assets. This manifest would be able to specify a local or remote (either or both) source for the asset, give information as to itโ€™s type (eg image/jpeg; document/pdf; text/html), specify creation date, location, title and alt-text, and almost above all, offer a stable UUID for referencing the asset.

JSON seems a sensible format for this manifest. Each object in the manifest would resemble the following:

"c871b94a-1ef0-47d2-9251-cfd7842c03e8": {
    "type": "image",
    "class": "photograph",
    "title": "Title of the photograph",
    "alt": "Optional alt text (title used if not present)",
    "src": {
        "old": "",
        "local": "",
        "remote":""
    }
}

As with transclusion and short referencing this should be strictly enforced, with a build failing when any non-existent or colliding asset is referenced.

See previous proposals involving handlers: SEP 45: Transclusion of documents, SEP 44: Short Reference Syntax, and ๐Ÿ— SEP 8: Create a shorthand for proposals.

The argument against this proposal

It would not be uncharitable to suggest that this proposal would introduce an added layer of indirection between a reference to an asset and the asset itself. Perhaps this comes at the cost of greater conceptual complexity. For now I believe this complexity is both manageable and warranted.