|
| 1 | +--- |
| 2 | +title: File structure |
| 3 | +--- |
| 4 | + |
| 5 | +In both the AsciiDoc- and V3-based systems, file structure is largely independent from the resulting site navigation. |
| 6 | + |
| 7 | +## File and directory structure |
| 8 | + |
| 9 | +AsciiDoc files and assets (like images and videos) can be stored anywhere within the directories provided as `sources` for a given book in the central [`config.yaml` file in the /docs repo](https://github.com/elastic/docs/blob/master/conf.yaml). |
| 10 | + |
| 11 | +## Migration tool output |
| 12 | + |
| 13 | +The migration tool will add all MD files in a single directory. There will be one MD file for each web page in the migrated book. The name of each MD file and the URL in the new docs system are both derived from the URL of the AsciiDoc-built page. |
| 14 | + |
| 15 | +**Example:** Here's what happens with the |
| 16 | +[Spans](https://www.elastic.co/guide/en/apm/guide/current/data-model-spans.html) page |
| 17 | +in the APM docs: |
| 18 | + |
| 19 | +* **Old URL**: The URL for the page in the old system is: |
| 20 | + `https://www.elastic.co/guide/en/apm/guide/current/data-model-spans.html`. |
| 21 | + From the URL, we can determine the: |
| 22 | + * _base URL_: `https://www.elastic.co/guide` |
| 23 | + * _book ID_: `en/apm/guide` |
| 24 | + * _version_: `current` |
| 25 | + * _page ID_: `data-model-spans` |
| 26 | +* **New filename**: The page ID determines the filename of the migrated MD file: |
| 27 | +% `data-model-spans.mdx`. This file will be in the root directory of the directory containing the content for the `en/apm/guide` book. |
| 28 | +* **New URL**: The new URL for this page in the new docs system will be `xxxx`. |
| 29 | +* |
| 30 | +Because a single AsciiDoc file can contain the content for multiple pages (or content |
| 31 | +displayed on a single page could be spread across multiple AsciiDoc files), the `.asciidoc` |
| 32 | +filename can be different than the `.md` filename. However, you should be able to locate |
| 33 | +the source content if you know which web page it lives on. |
| 34 | + |
| 35 | +In the output from the migration tool the slug (for example, `en/apm/guide/data-model-spans`) |
| 36 | +and the MD filename (for example, `data-model-spans.md`) are both derived from |
| 37 | +the page ID, they don't _have_ to be the same. |
| 38 | + |
| 39 | +### Assets |
| 40 | + |
| 41 | +The migration tool creates an `images/` directory in the base directory for the doc set. |
| 42 | +Inside the `images/` directory, there is subdirectory for each page ID that contains images. |
| 43 | + |
| 44 | +For example, the images that are used on the [Entity Analytics dashboard](https://www.elastic.co/guide/en/security/current/detection-entity-dashboard.html) page in the AsciiDoc Security book would be copied to |
| 45 | +the following location in the migrated docs: |
| 46 | + |
| 47 | +``` |
| 48 | +images |
| 49 | + └─ detection-entity-dashboard |
| 50 | + ├─ dashboards-anomalies-table.png |
| 51 | + ├─ dashboards-entity-dashboard.png |
| 52 | + ├─ dashboards-host-score-data.png |
| 53 | + ├─ dashboards-run-job.png |
| 54 | + └─ dashboards-user-score-data.png |
| 55 | +``` |
| 56 | + |
| 57 | +These can be reorganized post-migration. |
| 58 | + |
| 59 | +### Reusable content |
| 60 | + |
| 61 | +Reusable content is lost during migration. |
0 commit comments