| 1 | --- |
| 2 | depends: |
| 3 | - guide/syntax#importing-slides |
| 4 | - features/importing-slides |
| 5 | tags: [syntax] |
| 6 | description: | |
| 7 | Merge frontmatter from multiple markdown files. |
| 8 | --- |
| 9 | |
| 10 | # Frontmatter Merging |
| 11 | |
| 12 | You can provide frontmatter instructions from both your main entry and external markdown pages. If there are duplicate keys in them, the ones from the **main entry have the higher priority**. For example: |
| 13 | |
| 14 | ::: code-group |
| 15 | |
| 16 | ```md [./slides.md] |
| 17 | --- |
| 18 | src: ./cover.md |
| 19 | background: https://sli.dev/bar.png // [!code highlight] |
| 20 | class: text-center |
| 21 | --- |
| 22 | ``` |
| 23 | |
| 24 | ```md [./cover.md] |
| 25 | --- |
| 26 | layout: cover |
| 27 | background: https://sli.dev/foo.png // [!code highlight] |
| 28 | --- |
| 29 | |
| 30 | # Cover |
| 31 | |
| 32 | Cover Page |
| 33 | ``` |
| 34 | |
| 35 | ::: |
| 36 | |
| 37 | They will end up being equivalent to the following page: |
| 38 | |
| 39 | ```md |
| 40 | --- |
| 41 | layout: cover |
| 42 | background: https://sli.dev/bar.png // [!code highlight] |
| 43 | class: text-center |
| 44 | --- |
| 45 | |
| 46 | # Cover |
| 47 | |
| 48 | Cover Page |
| 49 | ``` |
| 50 |