Skip to content

Commit 563aaa7

Browse files
committed
an attempt to clarify all the config files
1 parent 6c41484 commit 563aaa7

File tree

14 files changed

+245
-238
lines changed

14 files changed

+245
-238
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ toc:
6464
children:
6565
- file: index.md
6666
- file: content.md
67-
- file: landing-page.md
68-
- file: redirects.md
67+
- file: navigation.md
68+
- file: versions.md
69+
- file: legacy-url-mappings.md
6970
- folder: content-set
7071
children:
7172
- file: index.md

docs/configure/content-sources.md

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,48 +30,20 @@ Tagged
3030
: Allows you to 'tag' a single git reference (typically a branch) as `current` which will be used to deploy to production.
3131
Allowing you to control the timing of when new documentation should go live.
3232

33+
### Add a new content set
3334

34-
### Continuous deployment
35+
To get started:
3536

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+
1. Follow our [guide](/migration/guide/index.md) to set up the new docs folder structure and CI configuration.
38+
1. Configure the repository source in `assembler.yml`. See [](./site/content.md) for details.
3739

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`.
40+
:::{note}
41+
The tagged branching strategy requires first following our [migration guide](/migration/guide/index.md) and configuring the documentation CI integration.
42+
Our CI integration checks will block until `current` is successfully configured.
43+
:::
3944

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.
48-
49-
```yaml
50-
references:
51-
my-repository:
52-
next: main
53-
current: main
54-
```
55-
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.
58-
59-
### Tagged
60-
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-
```
70-
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-
:::
45+
1. Inject the content set into the global navigation. See [](./site/navigation.md) for details.
46+
1. Optionally set up legacy URL mappings. See [](./site/legacy-url-mappings.md) for details.
7547

7648
#### CI configuration
7749

docs/configure/site/content.md

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,63 @@
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.
1317

14-
```
18+
Each environment specifies configuration details such as the site URI, content source, path prefix, Google Tag Manager settings, and feature flags.
19+
20+
## `shared_configuration`
21+
22+
This section defines YAML anchors for common settings shared among multiple repositories.
23+
24+
## `narrative`
25+
26+
Configures the main `docs-content` repository.
27+
28+
## `references`
29+
30+
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.
1531

16-
## Assembler constraints
32+
### Branching strategy
1733

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.
34+
How you add a reference repository depends on its [branching strategy](../content-sources.md#branching-strategies).
2435

25-
## AsciiDoctor conf.yml
36+
#### Continuous deployment repository
2637

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:
38+
To add a continuous deployment repository, define the name of the repository:
2839

2940
```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
41+
references:
42+
my-repository:
5543
```
44+
45+
The above configuration is equivalent to specifying.
46+
47+
```yaml
48+
references:
49+
my-repository:
50+
next: main
51+
current: main
52+
```
53+
54+
### Tagged repository
55+
56+
To add a tagged repository, configure the repo to have a fixed git reference (typically a branch) deploy the `current` content source to production.
57+
58+
```yaml
59+
references:
60+
my-other-repository:
61+
next: main
62+
current: 9.0
63+
```

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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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.
4+
5+
It ensures that users can easily find previous versions of our documentation.
6+
7+
## Structure
8+
9+
`stack anchor`
10+
: Defines a reusable list of version strings for "stack" projects, e.g., [ '9.0+', '8.18', ... ].
11+
12+
`mappings`
13+
: 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.
14+
15+
:::{important}
16+
The first version in the `mappings` list is treated as the "current" version in documentation version dropdown.
17+
:::
18+
19+
## Example entry
20+
21+
```yml
22+
en/elasticsearch/reference/: *stack
23+
```

docs/configure/site/navigation.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
## `toc`
6+
7+
The location of the table of contents file.
8+
9+
`repo_name://path-relative-to-toc.yml`
10+
11+
## `path_prefix` (optional)
12+
13+
The `path_prefix` configuration key specifies the URL path segment that should be prefixed to all documentation URLs.
14+
15+
listing all documentation sources and the corresponding `toc.yml` file that defines their navigation.
16+
17+
18+
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.
19+
20+
21+
22+
defines the structure and organization of the navigation menu for the Elastic documentation site.
23+
24+
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.
25+
26+
27+
28+
29+
% TODO we need [`navigation.yml](https://github.com/elastic/docs-builder/blob/main/config/navigation.yml`) docs
30+
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)