|
| 1 | +# DocsV3Layout Component Guide |
| 2 | + |
| 3 | +## What is DocsV3Layout? |
| 4 | + |
| 5 | +DocsV3Layout is the template that creates the standard layout for documentation pages on the Chainlink Docs website. Think of it as a "frame" that wraps around your content to give it a consistent look and feel. |
| 6 | + |
| 7 | +## What Does It Do? |
| 8 | + |
| 9 | +When you use this layout, it automatically creates: |
| 10 | + |
| 11 | +- **A left sidebar** with navigation links to help users find related pages |
| 12 | +- **A main content area** where your documentation content appears |
| 13 | +- **A header** that shows the page outline (on mobile devices) |
| 14 | +- **Responsive design** that adapts to different screen sizes (mobile, tablet, desktop) |
| 15 | + |
| 16 | +## How to Use It |
| 17 | + |
| 18 | +### Basic Setup |
| 19 | + |
| 20 | +To use this layout for a documentation page, you need to specify it at the top of your Markdown file: |
| 21 | + |
| 22 | +``` |
| 23 | +--- |
| 24 | +layout: ~/layouts/DocsV3Layout/DocsV3Layout.astro |
| 25 | +title: Your Page Title |
| 26 | +section: your-section-name |
| 27 | +--- |
| 28 | +
|
| 29 | +Your content goes here... |
| 30 | +``` |
| 31 | + |
| 32 | +### Required Information |
| 33 | + |
| 34 | +You need to provide two key pieces of information: |
| 35 | + |
| 36 | +1. **Title** - The name of your documentation page |
| 37 | + - Example: `title: Getting Started with Chainlink` |
| 38 | + |
| 39 | +2. **Section** - Which documentation section this page belongs to |
| 40 | + - Example: `section: quickstarts` |
| 41 | + - This helps organize pages in the left sidebar navigation |
| 42 | + |
| 43 | +### Optional Information |
| 44 | + |
| 45 | +You can also include: |
| 46 | + |
| 47 | +- **Metadata** - Special settings for the page, like SEO information |
| 48 | +- **Link to Wallet** - If your page needs blockchain wallet integration, add: |
| 49 | + ``` |
| 50 | + metadata: |
| 51 | + linkToWallet: true |
| 52 | + ``` |
| 53 | + |
| 54 | +## Example Usage |
| 55 | + |
| 56 | +Here's a complete example of how to set up a documentation page: |
| 57 | + |
| 58 | +``` |
| 59 | +--- |
| 60 | +layout: ~/layouts/DocsV3Layout/DocsV3Layout.astro |
| 61 | +title: How to Use Chainlink Data Feeds |
| 62 | +section: data-feeds |
| 63 | +--- |
| 64 | +
|
| 65 | +# How to Use Chainlink Data Feeds |
| 66 | +
|
| 67 | +This guide will teach you how to use data feeds... |
| 68 | +
|
| 69 | +## Step 1: Prerequisites |
| 70 | +
|
| 71 | +Before you begin, make sure you have... |
| 72 | +
|
| 73 | +## Step 2: Installation |
| 74 | +
|
| 75 | +To install the required packages... |
| 76 | +``` |
| 77 | + |
| 78 | +## What Happens Behind the Scenes |
| 79 | + |
| 80 | +When you use this layout: |
| 81 | + |
| 82 | +1. **Your title** becomes the main heading and appears in the page outline |
| 83 | +2. **Your headings** (anything starting with `#`, `##`, `###`) are automatically collected and used for navigation |
| 84 | +3. **The sidebar** is populated with links based on your section |
| 85 | +4. **The layout adapts** to the user's screen size automatically |
| 86 | + |
| 87 | +## Layout Structure |
| 88 | + |
| 89 | +The page is divided into three columns: |
| 90 | + |
| 91 | +``` |
| 92 | +┌──────────────┬─────────────────────┬──────────────┐ |
| 93 | +│ │ │ │ |
| 94 | +│ Left │ Main Content │ Right │ |
| 95 | +│ Sidebar │ (Your Docs) │ Sidebar │ |
| 96 | +│ (Navigation) │ │ (Future) │ |
| 97 | +│ │ │ │ |
| 98 | +└──────────────┴─────────────────────┴──────────────┘ |
| 99 | +``` |
| 100 | + |
| 101 | +- **Left Sidebar**: Shows navigation for the current section |
| 102 | +- **Main Content**: Your documentation content |
| 103 | +- **Right Sidebar**: Reserved for future use (currently empty) |
| 104 | + |
| 105 | +## Tips for Best Results |
| 106 | + |
| 107 | +1. **Use clear headings** - Your headings create the page outline, so make them descriptive |
| 108 | +2. **Keep titles concise** - The title appears in multiple places, so shorter is better |
| 109 | +3. **Choose the right section** - Make sure your page is in the correct section so users can find it |
| 110 | +4. **Limit heading depth** - Only headings up to level 4 (`####`) are included in the navigation |
0 commit comments