Skip to content

Commit ffcacea

Browse files
authored
Merge pull request #6834 from umbraco/images
Updated Images style guide article
2 parents d0a7a1e + b8c6c8b commit ffcacea

File tree

3 files changed

+76
-26
lines changed

3 files changed

+76
-26
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
![Caption](../images/sample.png)
46+
```
47+
48+
### Image with Alt Text (Markdown/GitHub)
49+
50+
```md
51+
![Alt text describing the image](images/img.png)
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+
![The New Backoffice](../images/sample.png)
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.

contributing/documentation/style-guide/markdown-conventions.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@ The Umbraco Documentation uses Markdown for all articles.
88

99
In this article you can learn how we Markdown for different elements on our documentation.
1010

11-
## Images
12-
13-
Images are linked using relative paths to `.md` pages.
14-
15-
The following sample adds an image, `img.png`, located in an `images` folder:
16-
17-
```markdown
18-
![My Image Alt Text](images/img.png)
19-
```
20-
21-
{% hint style="info" %}
22-
Make sure to add a descriptive image text that presents the user with the same information as the image provides.
23-
{% endhint %}
24-
2511
## Links
2612

2713
In the following you will find a few examples of different links.

contributing/documentation/style-guide/structure.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,3 @@ Each directory must have a `README.md` file which will act as a landing page for
2828
All file and directory names need to be small-caps in order to be synced properly with GitBook.
2929

3030
If an article is not a landing page, we recommend using the title of the article as the file name.
31-
32-
## Images
33-
34-
Images are stored and linked using relative paths to .md pages, and should by convention always be in an `images` directory. To add an image to `/documentation/reference/partials/renderviewpage.md` you link it like so:
35-
36-
```markdown
37-
![My Image Alt Text](images/img.png)
38-
```
39-
40-
And store the image as `/documentation/reference/partials/images/img.png`
41-
42-
Images can have a maximum width of **800px**. Please always try to use the most efficient compression, `gif` or `png`. No `bmp`, `tiff` or `swf` (Flash).

0 commit comments

Comments
 (0)