Storage plugin
Serves file attachments that live next to a content item — images, PDFs, quiz files for an Academy lesson, etc. — through a single, uniform URL, regardless of which content plugin owns the item.
Attachment convention
An attachment is any file placed in a _attachments/ subdirectory next to its content file, named after that file (without extension):
resources/content/academy/getting-started/introduction/what-is-this.md
resources/content/academy/getting-started/introduction/what-is-this/_attachments/
cheat-sheet.pdf
quiz.json
what-is-this.md’s attachments are exactly the files under what-is-this/_attachments/. Reference one from frontmatter as ?attachment=<filename> — see the test field of Academy lessons for a real example.
Route
| Route | Path | Description |
|---|---|---|
content_storage_download |
GET /{type}/{uri}/_attachments/{attachment} |
Downloads an attachment. type is the content type (docs, academy, etc.), uri is the item’s URI. |
Configuration (services.yaml)
None. Enabling the plugin (storage: ~) is all that’s needed — it has no options of its own, it only serves whatever attachments already exist next to items loaded by the other content plugins.
parameters:
derafu.content.config:
plugins:
storage: ~
Content frontmatter
Not applicable — attachments are files on disk, not content items, and are not referenced through frontmatter fields of their own (beyond however a specific plugin points at them, like Academy’s test).