|
| 1 | +--- |
| 2 | +description: >- |
| 3 | + Learn how to add images to the documentation. |
| 4 | +--- |
| 5 | + |
| 6 | +# Images |
| 7 | + |
| 8 | +Images should be stored in an `images` directory next to the `.md` file referencing them, using relative paths. Use descriptive alt text and captions to ensure accessibility and Search Engine Optimization (SEO) benefits. Optimize images for the web to improve page load times. |
| 9 | + |
| 10 | +## General Guidelines |
| 11 | + |
| 12 | +* Maximum image width: **800px**. |
| 13 | +* Supported formats: `png`, `jpg`, `gif` (use the most efficient compression available). |
| 14 | +* Prohibited formats: `bmp`, `tiff`, `swf` (Flash) |
| 15 | + |
| 16 | +## Folder Structure |
| 17 | + |
| 18 | +If images are used, these must be stored in an `images` directory next to the `.md` file referencing them using relative paths. |
| 19 | + |
| 20 | +Maintain a clear and consistent directory structure: |
| 21 | + |
| 22 | +```plaintext |
| 23 | +/topic # Main documentation directory |
| 24 | +│── README.md # Main content file |
| 25 | +│── another-page.md # Another markdown file |
| 26 | +│── /images # Image storage |
| 27 | +│ ├── image1.png |
| 28 | +│ ├── image2.jpg |
| 29 | +│ |
| 30 | +└── /subtopic # Subdirectory for related content |
| 31 | + │── README.md |
| 32 | + │── topic.md |
| 33 | + │── another-topic.md |
| 34 | + │── /images # Subdirectory for subtopic images |
| 35 | + ├── image3.png |
| 36 | +``` |
| 37 | + |
| 38 | +## Adding images in Markdown |
| 39 | + |
| 40 | +Use the following markdown syntax to insert images: |
| 41 | + |
| 42 | +### Image with Caption |
| 43 | + |
| 44 | +```md |
| 45 | + |
| 46 | +``` |
| 47 | + |
| 48 | +### Image with Alt Text (Markdown/GitHub) |
| 49 | + |
| 50 | +```md |
| 51 | + |
| 52 | +``` |
| 53 | + |
| 54 | +### Image with Alt Text |
| 55 | + |
| 56 | +Images added through the GitBook platform are automatically inserted using HTML syntax, as shown in the example below: |
| 57 | + |
| 58 | +```html |
| 59 | +<figure><img src="../images/sample.png" alt="The New Backoffice"></figure> |
| 60 | +``` |
| 61 | + |
| 62 | +However, when contributing to the documentation via GitHub, it is recommended to use Markdown for images instead: |
| 63 | + |
| 64 | +```md |
| 65 | + |
| 66 | +``` |
| 67 | + |
| 68 | +{% hint style="info" %} |
| 69 | +Always provide alt text or a caption to describe the image’s purpose and content. |
| 70 | +{% endhint %} |
| 71 | + |
| 72 | +## Best Practices |
| 73 | + |
| 74 | +* Use clear and relevant filenames. For example: `dashboard-view.png` instead of `image1.png`. |
| 75 | +* Avoid excessive text in images. If text is necessary, provide a description above or below the image in the documentation. |
| 76 | +* Use SVG format for diagrams and icons where possible to ensure scalability. |
0 commit comments