|
| 1 | +--- |
| 2 | +title: Edit your content |
| 3 | +navigation: |
| 4 | + title: Content editors |
| 5 | +description: Discover and select your favorite way to manage your content between the visual or the code editor. |
| 6 | +seo: |
| 7 | + title: Edit your Nuxt Content website with our editors |
| 8 | + description: Overview of our different Studio CMS editors to manage your content and your medias. Choose between our visual editors and our code editor. |
| 9 | +--- |
| 10 | + |
| 11 | +Nuxt Studio offers a versatile workspace for both developers and content writers, giving them the freedom to choose between our differents editors: |
| 12 | +- [Notion-like editor](#markdown-editor-markdown-files) for `Markdown` files |
| 13 | +- [Form editor](#form-editor-yaml-and-json-files) for `YAML` and `JSON` files |
| 14 | +- [Code editor](#code-editor) for any kind of files (for technical users only) |
| 15 | + |
| 16 | +::tip |
| 17 | +You can choose your favorite editor from the settings page of your project. |
| 18 | +:: |
| 19 | + |
| 20 | +Each editor serves its own purpose. Some users are used to code edition, while others prefer a non-technical, visual approach. At the end, **code syntax is the final output** for both editors. |
| 21 | + |
| 22 | +## Notion-like editor (`Markdown` files) |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +This editor is heavily inspired by Notion, well known for its intuitive design and flexibility. Much like a standard text editor, this editor is designed to be familiar and easy to use. However, it stands out with its additional features that improve the writing experience: |
| 27 | + |
| 28 | + |
| 29 | +### Front-matter |
| 30 | + |
| 31 | +[Front-matter](/docs/files/markdown#front-matter) is a convention of Markdown-based CMS to provide meta-data to pages, like description or title or any other data you would like to store as `key: value` pair. |
| 32 | + |
| 33 | +Based on the user [collection and schema](/docs/collection/define) provided, a form is generated to edit this metadata from the editor. |
| 34 | + |
| 35 | +:video{autoplay controls loop poster="/assets/home/videos/HomeNotionLikePoster.webp" src="https://res.cloudinary.com/nuxt/video/upload/v1729157955/frontmatterform2_rmh58v.mp4"} |
| 36 | + |
| 37 | +### Toolbar |
| 38 | + |
| 39 | +Highlight your text to reveal the toolbar, giving you access to all the standard text editing features (title formatting, Bold, Italic, Strike-through, code, link, class, bullet list, numerated list...). |
| 40 | + |
| 41 | +### Medias |
| 42 | + |
| 43 | +Users can simply drag and drop images directly into the editor. An upload modal will open to let you choose the destination folder. |
| 44 | + |
| 45 | +By typing `/` and searching for `Image` or `Video`, they can quickly insert a media. A modal will open to let them choose the media they want to insert from the media gallery (aka the`public` folder of the Nuxt application). |
| 46 | + |
| 47 | +From the media modal, you can set the [alt attribute](https://www.w3schools.com/tags/att_img_alt.asp) for SEO and accessibility purpose. |
| 48 | + |
| 49 | +### Vue Components |
| 50 | + |
| 51 | +One of this editor standout features is its ability to integrate and customize any complex `Vue` component directly within the editor. |
| 52 | + |
| 53 | +In other terms, a developer can create any kind of visually complex components and editors will be able to use them and focus on the content. An editor can also tweak the component properties, styles, and behavior to fit its specific requirements as long as the developer made it customizable. |
| 54 | + |
| 55 | +::steps{level="4"} |
| 56 | + |
| 57 | +#### Create your component |
| 58 | + |
| 59 | +You can create Vue components and integrate them into Markdown. They just need to be located in the `/components/content` folder to be available. |
| 60 | + |
| 61 | +```vue [components/content/HomeFeature.vue] |
| 62 | +<template> |
| 63 | + <div class="flex items-start gap-3"> |
| 64 | + <div class="flex items-center justify-center border rounded-lg p-1.5"> |
| 65 | + <UIcon :name="icon" /> |
| 66 | + </div> |
| 67 | + <div class="flex flex-col"> |
| 68 | + <h3 class="font-semibold"> |
| 69 | + <ContentSlot name="title" /> |
| 70 | + </h3> |
| 71 | + <span> |
| 72 | + <ContentSlot name="description" /> |
| 73 | + </span> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | +</template> |
| 77 | +
|
| 78 | +<script setup lang="ts"> |
| 79 | +defineProps({ |
| 80 | + icon: { |
| 81 | + type: String, |
| 82 | + default: 'i-ph-cursor-click', |
| 83 | + }, |
| 84 | +}) |
| 85 | +</script> |
| 86 | +``` |
| 87 | + |
| 88 | +#### Integrate these components easily within any Markdown file using [MDC syntax](/docs/files/markdown#mdc-syntax) |
| 89 | + |
| 90 | +```mdc [content/index.md] |
| 91 | +::home-feature |
| 92 | + --- |
| 93 | + icon: i-ph-cube |
| 94 | + --- |
| 95 | + #title |
| 96 | + Embedded Vue components |
| 97 | + #description |
| 98 | + Edit slots and props inside the Notion-like editor. |
| 99 | +:: |
| 100 | +``` |
| 101 | + |
| 102 | + |
| 103 | +#### Edit them with our Studio editors |
| 104 | + |
| 105 | +The visual editor simplifies the component edition, allowing you to integrate and edit them directly in the visual editor. Non technical users can play with **slots** and **props** without any technical knowledge. |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +All components in the `/components/content` folder are available in the editor. Studio users can type `/` anywhere while editing to access the list of available components. |
| 110 | + |
| 111 | +::tip{to="/docs/studio/debug"} |
| 112 | +Take a look at this section to validate your `Vue` component integration in the editor in local development. |
| 113 | +:: |
| 114 | + |
| 115 | +:: |
| 116 | + |
| 117 | +::tip{to="https://nuxt.studio/blog/visual-editor"} |
| 118 | +You want to know how we've built this editor and how it works under the hood? Check this blog post. |
| 119 | +:: |
| 120 | + |
| 121 | +## Form editor (`YAML` and `JSON` files) |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | +This editor removes the need for users to interact directly with complex file syntax such as `YAML` or `JSON`. |
| 126 | + |
| 127 | +Based on the user [collection and schema](/docs/collection/define) provided, a form is generated for both `YAML` and `JSON` files. |
| 128 | + |
| 129 | +::warning |
| 130 | +Arrays are not yet handled but should be generated soon thanks to collections and user-defined schemas. |
| 131 | +:: |
| 132 | + |
| 133 | +## Code editor |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | +Even though the two previous editors are dedicated to a specific file extension (`md` or `yaml`/`json`). The code editor can be used with any kind of file. |
| 138 | + |
| 139 | +It provides full control over your content, allowing you to write raw content directly: |
| 140 | +- [MDC](/docs/files/markdown) syntax for `Markdown` files |
| 141 | +- [JSON](/docs/files/json) or [YAML](/docs/files/yaml) syntax |
| 142 | + |
| 143 | +When your file is saved with the code editor, the content is stored exactly as you've written it, preserving all specific syntax and formatting. This editor is ideal for users comfortable with code syntax (`Markdown`, `YAML` or `JSON`) who want precise control over structure of their content. |
0 commit comments