Skip to content

Commit 648393c

Browse files
authored
An attempt to document all of the config files (#1610)
* an attempt to clarify all the config files * fixes Signed-off-by: bmorelli25 <[email protected]> * a little more Signed-off-by: bmorelli25 <[email protected]> * add new version guide Signed-off-by: bmorelli25 <[email protected]> * Update release-new-version.md --------- Signed-off-by: bmorelli25 <[email protected]>
1 parent f93cfb2 commit 648393c

15 files changed

+371
-240
lines changed

config/legacy-url-mappings.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
#############################################
2+
# This file defines the legacy URL mappings for the documentation site.
3+
# It maps current documentation pages to older versions to ensure users can find the content they need.
14
# TODO: Refactor the model, for now we just use the first element as current version
5+
#############################################
26

37
stack: &stack [ '9.0+', '8.18', '8.17', '8.16', '8.15', '8.14', '8.13', '8.12', '8.11', '8.10', '8.9', '8.8', '8.7', '8.6', '8.5', '8.4', '8.3', '8.2', '8.1', '8.0', '7.17' ]
48

config/navigation.yml

Lines changed: 62 additions & 65 deletions
Large diffs are not rendered by default.

docs/_docset.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ toc:
3737
- file: cumulative-docs.md
3838
- file: branching-strategy.md
3939
- file: add-repo.md
40+
- file: release-new-version.md
4041
- folder: migration
4142
children:
4243
- file: index.md
@@ -64,8 +65,9 @@ toc:
6465
children:
6566
- file: index.md
6667
- file: content.md
67-
- file: landing-page.md
68-
- file: redirects.md
68+
- file: navigation.md
69+
- file: versions.md
70+
- file: legacy-url-mappings.md
6971
- folder: content-set
7072
children:
7173
- file: index.md

docs/configure/content-sources.md

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,28 @@ This allows you as an owner of a repository to choose two different branching st
2323

2424
The new documentation system supports 2 branching strategies.
2525

26-
Continuous deployment
27-
: This is the default where a repositories `main` or `master` branch is continuously deployed to production.
26+
### Continuous deployment
2827

29-
Tagged
30-
: Allows you to 'tag' a single git reference (typically a branch) as `current` which will be used to deploy to production.
31-
Allowing you to control the timing of when new documentation should go live.
28+
This is the default where a repositories `main` or `master` branch is continuously deployed to production.
3229

30+
### Tagged
3331

34-
### Continuous deployment
35-
36-
This is the default. To get started, follow our [guide](/migration/guide/index.md) to set up the new docs folder structure and CI configuration.
37-
38-
Once setup ensure the repository is added to our [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) under `references`.
39-
40-
For example say you want to onboard `elastic/my-repository` into the production build:
41-
42-
```yaml
43-
references:
44-
my-repository:
45-
```
46-
47-
Is equivalent to specifying.
32+
Allows you to 'tag' a single git reference (typically a branch) as `current` which will be used to deploy to production. Allowing you to control the timing of when new documentation should go live.
4833

49-
```yaml
50-
references:
51-
my-repository:
52-
next: main
53-
current: main
54-
```
34+
### Add a new content set
5535

56-
% TODO we need navigation.yml docs
57-
Once the repository is added, its navigation still needs to be injected into to global site navigation.
36+
To get started:
5837

59-
### Tagged
38+
1. Follow our [guide](/migration/guide/index.md) to set up the new docs folder structure and CI configuration.
39+
1. Configure the repository source in `assembler.yml`. See [](./site/content.md) for details.
6040

61-
If you want to have more control over the timing of when your docs go live to production. Configure the repository
62-
in our [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) to have a fixed git reference (typically a branch) deploy the `current` content source to production.
63-
64-
```yaml
65-
references:
66-
my-other-repository:
67-
next: main
68-
current: 9.0
69-
```
41+
:::{note}
42+
The tagged branching strategy requires first following our [migration guide](/migration/guide/index.md) and configuring the documentation CI integration.
43+
Our CI integration checks will block until `current` is successfully configured.
44+
:::
7045

71-
:::{note}
72-
In order for `9.0` to be onboarded it needs to first follow our [migration guide](/migration/guide/index.md) and have our documentation CI integration setup.
73-
Our CI integration checks will block until `current` is successfully configured
74-
:::
46+
1. Inject the content set into the global navigation. See [](./site/navigation.md) for details.
47+
1. Optionally set up legacy URL mappings. See [](./site/legacy-url-mappings.md) for details.
7548

7649
#### CI configuration
7750

docs/configure/site/content.md

Lines changed: 86 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,100 @@
1+
---
2+
navigation_title: assembler.yml
3+
---
4+
15
# `assembler.yml`
26

3-
The global navigation is defined in the [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) file. This file can roughly be thought of as the V3 equivalent of conf.yaml in the asciidoc build system. This file, which writers own, allows for arbitrary nesting of `docset.yml` and `toc.yml` references. This file will live in the `elastic/docs-content` repository, but will not build or have any influence over the `docs-builder` builds in that repo.
7+
The [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) file defines the global documentation site:
48

5-
The global navigation that is defined in [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) can be composed of three main resources:
6-
1. Local TOC files: toc.yml files that live in the docs-content repository.
7-
2. External TOC files: A subset of a content set (represented by a toc.yml file) that is external to the docs-content repository.
8-
3. External content set declarations: An entire docset.yml file that is external to the docs-content repository.
9+
* `environments`
10+
* `shared_configuration`
11+
* narrative repository configuration
12+
* reference repository configurations
913

10-
The [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) file might look something like this:
14+
## `environments`
1115

12-
```yaml
16+
This section defines different build environments for the documentation site.
17+
18+
Each environment specifies configuration details such as the site URI, content source, path prefix, Google Tag Manager settings, and feature flags.
19+
20+
Example:
21+
22+
```yml
23+
environments:
24+
prod:
25+
uri: https://www.elastic.co
26+
path_prefix: docs
27+
content_source: current
28+
allow_indexing: true
29+
google_tag_manager:
30+
enabled: true
31+
id: GTM-KNJMG2M
32+
```
33+
34+
## `shared_configuration`
1335

36+
This section defines YAML anchors for common settings shared among multiple repositories and deployment environments.
37+
38+
The following example sets a unique `stack` version for each of the three defined deployment environments:
39+
40+
```yml
41+
stack: &stack
42+
current: 9.0
43+
next: 9.1
44+
edge: main
1445
```
1546

16-
## Assembler constraints
47+
## `narrative`
1748

18-
To maintain each docset’s immutability and self-containment, resources in the global navigation (assembler.yml) must follow specific rules.
19-
1. A link resource can appear only once in the global navigation, and it must nest directly under another resource (not under individual pages from a different content set). In other words:
20-
1. Each docset.yml or toc.yml file can appear only once in the overall navigation.
21-
1. Any TOC declarations—whether in docset.yml or toc.yml—must be placed either at the top level or directly under another TOC entry, with no individual files in between.
22-
1. Nested resources must appear either before or after (default) the parent’s TOC, and they cannot be placed arbitrarily among the parent’s pages (e.g., between two files of the parent).
23-
1. If an external TOC is linked, all of its child TOCs must also be included in the global navigation.
49+
Configures the main `docs-content` repository.
2450

25-
## AsciiDoctor conf.yml
51+
Example:
52+
53+
```yml
54+
narrative:
55+
checkout_strategy: full
56+
```
2657

27-
In the AsciiDoctor-powered site, content configuration at the site level is done in the [`conf.yaml`](https://github.com/elastic/docs/blob/master/conf.yaml) file in the elastic/docs repo. In the `conf.yml` file, the configuration information for all books are listed in this one file. Here's the example of what it looks like to configure a single book:
58+
## `references`
59+
60+
Configures all other repositories whose docs content should be included or referenced in the build. Each can have custom settings for branch, checkout method, etc.
61+
62+
Example:
63+
64+
```yml
65+
references:
66+
apm-server:
67+
```
68+
69+
### Branching strategy
70+
71+
How you add a reference repository depends on its [branching strategy](../content-sources.md#branching-strategies).
72+
73+
#### Continuous deployment repository
74+
75+
To add a continuous deployment repository, define the name of the repository:
2876

2977
```yaml
30-
- title: Machine Learning
31-
prefix: en/machine-learning
32-
current: *stackcurrent
33-
index: docs/en/stack/ml/index.asciidoc
34-
branches: [ {main: master}, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 7.15, 7.14, 7.13, 7.12, 7.11, 7.10, 7.9, 7.8, 7.7, 7.6, 7.5, 7.4, 7.3, 7.2, 7.1, 7.0, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3 ]
35-
live: *stacklive
36-
chunk: 1
37-
tags: Elastic Stack/Machine Learning
38-
subject: Machine Learning
39-
sources:
40-
-
41-
repo: stack-docs
42-
path: docs/en/stack
43-
-
44-
repo: elasticsearch
45-
path: docs
46-
-
47-
repo: docs
48-
path: shared/versions/stack/{version}.asciidoc
49-
-
50-
repo: docs
51-
path: shared/attributes.asciidoc
52-
-
53-
repo: docs
54-
path: shared/settings.asciidoc
78+
references:
79+
my-repository:
5580
```
81+
82+
The above configuration is equivalent to specifying.
83+
84+
```yaml
85+
references:
86+
my-repository:
87+
next: main
88+
current: main
89+
```
90+
91+
### Tagged repository
92+
93+
To add a tagged repository, configure the repo to have a fixed git reference (typically a branch) deploy the `current` content source to production.
94+
95+
```yaml
96+
references:
97+
my-other-repository:
98+
next: main
99+
current: 9.0
100+
```

docs/configure/site/index.md

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,17 @@ navigation_title: Site-level
44

55
# Site-level configuration
66

7-
Start by understanding how the new V3 system works at the site level compared to how our custom AsciiDoctor system works. At the site-level, we have:
7+
Configure the documentation site in these files:
88

9-
| System property | Asciidoc | V3 |
10-
| -------------------- | -------------------- | -------------------- |
11-
| **Content sources** --> Collections of markup files containing doc content. These are split up across many docs repos. | _Books_ | _Content sets_ |
12-
| **Content configuration** --> A way to specify where to find those content sources, and in what order they should be added to the site. | Configuration file ([`conf.yml`](https://github.com/elastic/docs/blob/master/conf.yaml) in elastic/docs) | Config file `assembler.yml` |
13-
14-
Where these pieces live and what format they are in varies between the two systems, but they generally achieve the same goal.
15-
16-
## Content sources
17-
18-
TBD
19-
20-
## Content configuration
21-
22-
In both the AsciiDoctor- and V3-based system, there is site-wide configuration where you list all content sources, where to find those sources, and in what order they should be added to the site.
23-
24-
In the AsciiDoctor system, this all happens in one YAML file in the `/docs` repo. In the V3 system:
25-
* Content configuration happens in the [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/config/assembler.yml) file in `docs-builder`.
26-
* Navigation configuration happens in the [`navigation.yml`](https://github.com/elastic/docs-builder/blob/main/config/navigation.yml) file in `docs-builder`.
27-
28-
[assembler.yml](./content.md)
29-
30-
## Landing page
31-
32-
See [landing page](./landing-page.md)
9+
- [](./content.md) - build environments and repository sources
10+
- [](./navigation.md) - global navigation index
11+
- [](./versions.md) - global versioning schemes
12+
- [](./legacy-url-mappings.md) - supported legacy version
3313

3414
## Redirects
3515

36-
Plan still needed
16+
Redirects are also configured at the site-level. See [](../../contribute/redirects.md) for more information.
3717

3818
## V3 site-level diagram
3919

40-
DIAGRAM NEEDED
41-
42-
## Asciidoc site-level diagram
43-
44-
![site-level config in the asciidoc system](./img/site-level-asciidoctor.png)
20+
*Coming soon*

docs/configure/site/landing-page.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Legacy URL mappings
2+
3+
This [`legacy-url-mappings.yml`](https://github.com/elastic/docs-builder/blob/main/config/legacy-url-mappings.yml) file manages legacy URL patterns for Elastic documentation, mapping the path of each legacy build URL to a list of documentation versions. It ensures that users can easily find previous versions of our documentation.
4+
5+
This example maps documentation that references `elastic.co/guide/en/elasticsearch/reference/ to Elastic Stack versioned URL paths:
6+
7+
```yml
8+
en/elasticsearch/reference/: *stack
9+
```
10+
11+
## Structure
12+
13+
`stack anchor`
14+
: Defines a reusable list of version strings for "stack" projects, e.g., [ '9.0+', '8.18', ... ].
15+
16+
`mappings`
17+
: A YAML mapping where each key is a legacy documentation URL path (like `en/apm/agent/java/`) and the value is a list of asciidoc versions that exist for that path.
18+
19+
:::{important}
20+
The first version in the `mappings` list is treated as the "current" version in documentation version dropdown.
21+
:::
22+
23+
## Example entry
24+

docs/configure/site/navigation.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# `navigation.yml`
2+
3+
The [`navigation.yml`](https://github.com/elastic/docs-builder/blob/main/config/navigation.yml) file acts as a global navigation index. Each entry points to a `toc.yml` file, which contains the navigation tree for that section. This design allows each section/project/team to manage its own navigation independently of other content sets.
4+
5+
Example:
6+
7+
```yml
8+
toc:
9+
- toc: get-started # No toc.yml indicates a docs-content directory
10+
- toc: extend
11+
children:
12+
- toc: kibana://extend # A toc.yml file in the Kibana repo at docs/extend
13+
path_prefix: extend/kibana # The URL path for built content will be elastic.co/docs/extend/kibana/FILE_PATH+NAME
14+
```
15+
16+
## `toc`
17+
18+
The location of the table of contents file.
19+
20+
`repo_name://path-relative-to-toc.yml`
21+
22+
## `path_prefix` (optional)
23+
24+
The `path_prefix` configuration key specifies the URL path segment that should be prefixed to all documentation URLs.
25+
26+
listing all documentation sources and the corresponding `toc.yml` file that defines their navigation.
27+
28+
29+
table of roots and specifying the location of each documentation section’s table of contents (toc.yml) file. Every entry in navigation.yml must reference a toc.yml file, which actually defines the navigation structure for that documentation section.
30+
31+
32+
33+
defines the structure and organization of the navigation menu for the Elastic documentation site.
34+
35+
The file is composed of nested YAML objects, where each object represents a navigation node. Navigation nodes can be categories, sections, or links to documentation pages.
36+
37+
38+
39+
40+
% TODO we need [`navigation.yml](https://github.com/elastic/docs-builder/blob/main/config/navigation.yml`) docs
41+
Once the repository is added, its navigation still needs to be injected into to global site navigation.

docs/configure/site/redirects.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)