Skip to content

Commit 857a82e

Browse files
Add clarification about using / for image paths relative to fern folder root (#1627)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <[email protected]>
1 parent e55f8e2 commit 857a82e

File tree

1 file changed

+14
-2
lines changed
  • fern/products/docs/pages/component-library/writing-content

1 file changed

+14
-2
lines changed

fern/products/docs/pages/component-library/writing-content/markdown.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,27 @@ Read the [Introduction](/learn/overview/introduction).
6969

7070
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.
7171

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`.
74+
</Info>
75+
7276
<Tabs>
7377
<Tab title="Markdown">
7478
```markdown
75-
![Alt text](./path/to/image.png "Optional title")
79+
<!-- Relative to page location -->
80+
![Alt text](../../assets/images/logo.png "Optional title")
81+
82+
<!-- Relative to fern folder root -->
83+
![Alt text](/assets/images/logo.png "Optional title")
7684
```
7785
</Tab>
7886
<Tab title="HTML">
7987
```html
80-
<img src="../assets/images/overview.png" width="500px" height="auto" />
88+
<!-- Relative to page location -->
89+
<img src="../../assets/images/logo.png" width="500px" height="auto" />
90+
91+
<!-- Relative to fern folder root -->
92+
<img src="/assets/images/logo.png" width="500px" height="auto" />
8193
```
8294
</Tab>
8395
</Tabs>

0 commit comments

Comments
 (0)