|
1 | 1 | # Shared content |
2 | 2 |
|
3 | 3 | This section is for content shared across multiple products and versions. |
4 | | -The `/shared/_index.md` frontmatter, marks the `/shared` directory and its |
5 | | -children as draft so they |
6 | | -don't get rendered when the site is built, but the contents of each shared |
7 | | -documented is included in pages that use the file as a `source` in their |
8 | | -frontmatter. |
| 4 | +The `/shared/_index.md` frontmatter marks the `/shared` directory (`/content/shared`) and its |
| 5 | +children as draft so they don't get rendered independently when the site is built. |
| 6 | +The content of each shared document is included and rendered in pages that reference the |
| 7 | +file as a `source` in their frontmatter. |
9 | 8 |
|
10 | 9 | ## Use shared content |
11 | 10 |
|
12 | | -1. Create a new folder for the content in the `content/shared/` directory. |
| 11 | +1. Create a new folder for the content in the `/content/shared/` directory. |
13 | 12 | 2. Copy the markdown files into the new folder. |
14 | | -3. Remove the frontmatter from the markdown files in the shared directory. If the first line starts with a shortcode, add an HTML comment before the first line, otherwise hugo will err. |
| 13 | +3. Remove any frontmatter from the markdown files in the shared directory. If the first line starts with a shortcode, add an HTML comment before the first line, otherwise Hugo will err. |
15 | 14 | 4. In each of the files that use the shared content, add a source to the frontmatter that points to the shared markdown file—for example: |
16 | 15 |
|
17 | 16 | ```markdown |
18 | 17 | source: /shared/influxql-v3-reference/regular-expressions.md |
19 | 18 | ``` |
20 | 19 |
|
21 | | -5. In the doc body, remove the shared Markdown text and add a comment that points to the shared file, in case someone happens upon the page in the repo--for example, in `/content/3/core/reference/influxql/regular-expressions.md`, add the following: |
| 20 | +5. In the doc body, remove the shared Markdown text and add a comment that points to the shared file, in case someone happens upon the page in the repo--for example, in `/content/influxdb3/core/reference/influxql/regular-expressions.md`, add the following: |
22 | 21 |
|
23 | 22 | <!-- |
24 | | -The content of this page is at /content/shared/influxql-v3-reference/regular-expressions.md |
| 23 | +//SOURCE - /content/shared/influxql-v3-reference/regular-expressions.md |
25 | 24 | --> |
| 25 | + |
| 26 | +`//SOURCE` is a comment anchor (recognized by the Comment Anchors editor extension) |
| 27 | +to make the file path clickable. |
0 commit comments