From c8d6486d43e93065ac65fbd064bc27e5b6ba8fac Mon Sep 17 00:00:00 2001 From: "Jord Gui [SSW]" <41951199+Jord-Gui@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:30:08 +1000 Subject: [PATCH 1/6] Update repo-based.md --- content/docs/reference/media/repo-based.md | 61 +++++++++++++++++++--- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/content/docs/reference/media/repo-based.md b/content/docs/reference/media/repo-based.md index 5841e032f..f35da961e 100644 --- a/content/docs/reference/media/repo-based.md +++ b/content/docs/reference/media/repo-based.md @@ -11,7 +11,7 @@ Repo-based media storage is the default media storage solution for TinaCMS. To configure repo-based media in your project, add the following to your schema definition in `tina/config.{ts,js}` -```ts +```javascript //tina/config.{ts,js} export default defineConfig({ @@ -46,14 +46,62 @@ E.g, in our [tina-cloud-starter](https://github.com/tinacms/tina-cloud-starter/t This property determines whether media files can be uploaded, edited, or deleted directly through the editor. -- **`static: true`** Editors cannot upload/delete media (static assets) -- **`static: false`** (default): Editors can upload/delete media (dynamic assets). +* **`static: true`** Editors cannot upload/delete media (static assets) +* **`static: false`** (default): Editors can upload/delete media (dynamic assets). + +### Overriding the default accepted media types +The following file types are supported by default + +| Format | MIME Type | Examples | +|------------------------------------------------------------|--------------------------------------------------------------|--------------------------------| +| Adobe InDesign | `application/x-indesign` | .indd | +| Apple HTTP Live Streaming | `application/vnd.apple.mpegurl` | .m3u8 | +| Binary File | `application/octet-stream` | .bin | +| Filmbox | `model/fbx` | .fbx | +| GL Transmission Format (JSON) | `model/gltf+json` | .gltf | +| Images | `image/*` | .jpg, .png, .gif, etc. | +| JSON | `application/json` | .json | +| JSON-LD | `application/ld+json` | .jsonld | +| Material Exchange Format | `application/mxf` | .mxf | +| Microsoft Excel (Legacy) | `application/vnd.ms-excel` | .xls | +| Microsoft Excel (OpenXML) | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | .xlsx | +| Microsoft Word (Legacy) | `application/msword` | .doc | +| Microsoft Word (OpenXML) | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | .docx | +| MPEG-DASH | `application/dash+xml` | .mpd | +| PDF | `application/pdf` | .pdf | +| Polygon File Format | `model/ply` | .ply | +| PostScript | `application/postscript` | .ps, .eps, etc. | +| Text Files | `text/*` | .txt, .md, etc. | +| U3D Mesh | `model/u3d+mesh` | .u3d | +| USDZ Zip | `model/vnd.usdz+zip` | .usdz | +| Videos | `video/*` | .mp4, .avi, .mkv, etc. | + + +If you would like to specify your own allowed file types, add the following below the **`tina`** property + +```javascript +//tina/config.{ts,js} + +export default defineConfig({ + // ... + media: { + tina: { + //.. + }, + accept: ['image/jpeg', 'video/mp4'], + }, +}) +``` + +### `accept` (String\[]) + +This property determines the filetypes that can be uploaded. ### next/image If you are using Next images, you will need to add the following to your `next.config.js` file to allow access to external images hosted on the Tina media hostname: -```js +```javascript module.exports = { images: { domains: ['assets.tina.io'], @@ -69,7 +117,7 @@ Once media has been configured, you can use `image` fields in your collections. In your `schema` add a new `image` field to a collection, e.g: -```ts +```javascript // ... { name: 'hero', @@ -92,8 +140,7 @@ Repo-based media is designed to be used around a single-branch workflow. If your * If you only have a single branch with media enabled, the media store will source/upload images to/from that branch. * If you have multiple branches with media enabled, then all media will be sourced/uploaded to/from the repository's default branch. -If you are configuring Tina on a non-default branch (and the Tina config has not yet been merged to your default branch), you may see this message in the Tina Cloud media settings:\ - +If you are configuring Tina on a non-default branch (and the Tina config has not yet been merged to your default branch), you may see this message in the Tina Cloud media settings:\\ ![](https://res.cloudinary.com/forestry-demo/image/upload/v1688478218/tina-io/docs/media-not-configured_lnr5lw.png)\ \ From 516aa798c38cb347dccd888c987cb9d56c63a43f Mon Sep 17 00:00:00 2001 From: "Jord Gui [SSW]" <41951199+Jord-Gui@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:40:05 +1000 Subject: [PATCH 2/6] Fix bracket error in UI --- content/docs/reference/media/repo-based.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reference/media/repo-based.md b/content/docs/reference/media/repo-based.md index f35da961e..558f01267 100644 --- a/content/docs/reference/media/repo-based.md +++ b/content/docs/reference/media/repo-based.md @@ -93,7 +93,7 @@ export default defineConfig({ }) ``` -### `accept` (String\[]) +### `accept` (List) This property determines the filetypes that can be uploaded. From 9e5273a27661a1f0117a3cebb888246540f58bec Mon Sep 17 00:00:00 2001 From: "Jord Gui [SSW]" <41951199+Jord-Gui@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:41:09 +1000 Subject: [PATCH 3/6] Escape angle brackets --- content/docs/reference/media/repo-based.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reference/media/repo-based.md b/content/docs/reference/media/repo-based.md index 558f01267..d1458cd84 100644 --- a/content/docs/reference/media/repo-based.md +++ b/content/docs/reference/media/repo-based.md @@ -93,7 +93,7 @@ export default defineConfig({ }) ``` -### `accept` (List) +### `accept` (List\) This property determines the filetypes that can be uploaded. From 1f804087ab17cc983051fa38b63c4f1672ecd1fb Mon Sep 17 00:00:00 2001 From: "Jord Gui [SSW]" Date: Mon, 22 Jul 2024 09:10:47 +1000 Subject: [PATCH 4/6] Update content/docs/reference/media/repo-based.md Co-authored-by: Kelly Davis --- content/docs/reference/media/repo-based.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reference/media/repo-based.md b/content/docs/reference/media/repo-based.md index d1458cd84..da8baf501 100644 --- a/content/docs/reference/media/repo-based.md +++ b/content/docs/reference/media/repo-based.md @@ -77,7 +77,7 @@ The following file types are supported by default | Videos | `video/*` | .mp4, .avi, .mkv, etc. | -If you would like to specify your own allowed file types, add the following below the **`tina`** property +If you would like to specify your own allowed file types, add the following to the **`media`** property ```javascript //tina/config.{ts,js} From e409aaa60d80c44ff3f4cfe5dc2d37b5a57766e4 Mon Sep 17 00:00:00 2001 From: "Jord Gui [SSW]" Date: Mon, 29 Jul 2024 16:28:49 +1000 Subject: [PATCH 5/6] Update content/docs/reference/media/repo-based.mdx Co-authored-by: Jack Pettit [SSW] <57518417+JackDevAU@users.noreply.github.com> --- content/docs/reference/media/repo-based.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reference/media/repo-based.mdx b/content/docs/reference/media/repo-based.mdx index da8baf501..f8aa117a7 100644 --- a/content/docs/reference/media/repo-based.mdx +++ b/content/docs/reference/media/repo-based.mdx @@ -140,7 +140,7 @@ Repo-based media is designed to be used around a single-branch workflow. If your * If you only have a single branch with media enabled, the media store will source/upload images to/from that branch. * If you have multiple branches with media enabled, then all media will be sourced/uploaded to/from the repository's default branch. -If you are configuring Tina on a non-default branch (and the Tina config has not yet been merged to your default branch), you may see this message in the Tina Cloud media settings:\\ +If you are configuring Tina on a non-default branch (and the Tina config has not yet been merged to your default branch), you may see this message in the Tina Cloud media settings: ![](https://res.cloudinary.com/forestry-demo/image/upload/v1688478218/tina-io/docs/media-not-configured_lnr5lw.png)\ \ From 628d7ea766b54e4223a66b5e9a21f86e38fd9a89 Mon Sep 17 00:00:00 2001 From: "Jord Gui [SSW]" Date: Mon, 29 Jul 2024 16:29:00 +1000 Subject: [PATCH 6/6] Update content/docs/reference/media/repo-based.mdx Co-authored-by: Jack Pettit [SSW] <57518417+JackDevAU@users.noreply.github.com> --- content/docs/reference/media/repo-based.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/media/repo-based.mdx b/content/docs/reference/media/repo-based.mdx index f8aa117a7..d56cfca11 100644 --- a/content/docs/reference/media/repo-based.mdx +++ b/content/docs/reference/media/repo-based.mdx @@ -142,6 +142,6 @@ Repo-based media is designed to be used around a single-branch workflow. If your If you are configuring Tina on a non-default branch (and the Tina config has not yet been merged to your default branch), you may see this message in the Tina Cloud media settings: -![](https://res.cloudinary.com/forestry-demo/image/upload/v1688478218/tina-io/docs/media-not-configured_lnr5lw.png)\ -\ +![](https://res.cloudinary.com/forestry-demo/image/upload/v1688478218/tina-io/docs/media-not-configured_lnr5lw.png) + To workaround this, you may need to enable media **after** merging Tina to your default branch.