@@ -66,71 +66,81 @@ Write descriptive link text that makes sense on its own:
6666
6767Avoid generic phrases like "click here" or "read more."
6868
69- ### Internal Links with ` relref `
69+ ### Internal Links
7070
71- Use Hugo's ` relref ` shortcode for internal links to other documentation pages:
71+ Use standard Markdown links with relative or absolute paths. Docusaurus automatically resolves internal links within the documentation.
7272
73+ ** Relative paths** (from the current file):
7374```
74- [link text]({{< relref "filename.md" >}})
75+ [link text](./filename.md)
76+ [link text](../parent-dir/filename.md)
7577```
7678
77- For links to specific sections, include the anchor :
79+ ** Absolute paths ** (from the docs root) :
7880```
79- [link text]({{< relref " filename.md#section-anchor" >}} )
81+ [link text](/path/to/ filename.md)
8082```
8183
82- For files in subdirectories, use absolute paths from the ` content ` directory :
84+ ** Links to specific sections ** (using heading anchors) :
8385```
84- [link text]({{< relref "/path/to/file.md" >}})
86+ [link text](./filename.md#section-anchor)
87+ [link text](/path/to/filename.md#section-anchor)
8588```
8689
8790** Examples:**
88- - ` {{< relref "dgraph-glossary.md#entity" >}} ` - Links to the entity section in glossary
89- - ` {{< relref "/dql/query/functions.md#aggregation-functions" >}} ` - Links to a section in a subdirectory
91+ - ` [Dgraph Glossary](dgraph-glossary.md#entity) ` - Links to the entity section in glossary
92+ - ` [Query Functions](/dql/query/functions.md#aggregation-functions) ` - Links to a section in a subdirectory
93+ - ` [Admin Tasks](../admin/admin-tasks/index.md) ` - Relative link from a subdirectory
9094
9195** Best practices:**
92- - Always use ` relref ` for internal documentation links
96+ - Use relative paths when linking within the same section
97+ - Use absolute paths (starting with ` / ` ) for cross-section links
98+ - Docusaurus automatically generates anchors from headings (lowercase, hyphens for spaces)
9399- Use descriptive link text that makes sense without context
94100- Test links after adding them to ensure they resolve correctly
95101
96102## Images and Figures
97103
98- Use Hugo shortcodes to include images in documentation:
104+ Use standard Markdown image syntax or MDX components to include images in documentation.
99105
100- ### Figure Shortcode
106+ ### Standard Markdown Images
101107
102- Use the ` figure ` shortcode for images with captions and optional styling :
108+ For simple images, use standard Markdown syntax :
103109
104110```
105- {{<figure class="medium image" src="/images /path/to/image.png" title="Image Title" alt="Alt text">}}
111+ 
106112```
107113
108- ** Attributes:**
109- - ` src ` : Path to image file (stored in ` static/images/ ` )
110- - ` title ` : Caption displayed with the image
111- - ` alt ` : Alternative text for accessibility (required)
112- - ` class ` : Optional styling class (e.g., ` "medium image" ` , ` "large image" ` )
114+ For images with titles (captions), use:
113115
114- ** Example:**
115116```
116- {{<figure class="medium image" src="/images/tutorials/graph-example .png" title="Example graph structure" alt="A graph showing nodes and relationships">}}
117+ 
117118```
118119
119- ### Load-img Shortcode
120+ ### MDX Image Components
120121
121- Use ` load-img ` for simple images without captions :
122+ For more control over image styling and layout, you can use MDX components in ` .mdx ` files :
122123
124+ ``` jsx
125+ import Image from ' @theme/IdealImage' ;
126+
127+ < Image img= {require (' @site/static/img/path/to/image.png' )} alt= " Alt text" / >
123128```
124- {{% load-img "/images/path/to/image.png" "Alt text" %}}
129+
130+ Or use standard HTML ` <img> ` tags with styling:
131+
132+ ``` html
133+ <img src =" /img/path/to/image.png" alt =" Alt text" title =" Image Title" style ={{maxWidth : ' 600px' }} />
125134```
126135
127136** Best practices:**
128- - Store images in ` static/images / ` directory
137+ - Store images in ` static/img / ` directory (or ` static/images/ ` if that's your convention)
129138- Always provide descriptive ` alt ` text for accessibility
130139- Use descriptive file names (e.g., ` graph-example.png ` not ` img1.png ` )
131140- Keep image file sizes reasonable for web performance
132- - Use ` figure ` for images that need captions or explanations
133- - Use ` load-img ` for simple inline images
141+ - Use absolute paths starting with ` /img/ ` or ` /images/ ` for images
142+ - For images that need captions, include the title in the image syntax or use HTML with a caption
143+ - Consider image dimensions and responsive design when embedding large images
134144
135145## Grammar & Language
136146
0 commit comments