You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/component-library/writing-content/markdown.mdx
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,15 +69,27 @@ Read the [Introduction](/learn/overview/introduction).
69
69
70
70
You can use locally stored images or URLs to include images in your Markdown pages. Use either [Markdown syntax](https://www.markdownguide.org/basic-syntax/#images-1) or the [`<img>` HTML tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) to insert the image.
71
71
72
+
<Info title="Image paths">
73
+
You can reference images using paths relative to the page's location (using `./` or `../`) or relative to the `fern` folder root (using `/`). For example, an image at `fern/assets/images/logo.png` can be referenced from any page as `/assets/images/logo.png`.
For more details about the HTML image element and its attributes, see the [MDN documentation on the img element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img).
97
109
</Note>
98
110
99
-
### Image paths
100
-
101
-
When referencing images, you can use either relative paths (`./` or `../`) or paths relative to the root of the `fern` folder by using `/`. For example, if you have an image at `fern/assets/images/overview.png`, you can reference it from any page using `/assets/images/overview.png`:
102
-
103
-
```markdown
104
-

105
-
```
106
-
107
-
This is equivalent to using a relative path like `../../assets/images/overview.png`, but is more concise and doesn't depend on the current page's location in the folder structure.
108
-
109
111
## Embedding local assets
110
112
111
113
You can embed local assets in your Markdown pages using the [`<embed>` component](/learn/docs/content/components/embed). This is useful for displaying PDFs, images, videos, OpenAPI files, and other assets into your docs.
0 commit comments