dotnet / dotnet/docfx

Is there any way to create a yaml header variable and use it within markdown?

Open
#5,859 5 comments 7 reactions 0 assignees View on GitHub
customization
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Operation System**: (`Windows` or `Linux` or `MacOS`)

**DocFX Version Used**:

2.50

**Template used**: (`default` or `statictoc` or contain custom template)

custom

**Steps to Reproduce**:

I just want to be able to define variables, both globally and hopefully within a yaml header and then reference them within the markdown file.

For example, in an md file I might have:

```
---
uid: download/4.8.0-beta00008
currentVersion: 4.8.0-beta00008
---
```

Then I want to be able to use the `currentVersion` variable/front-matter/yaml-header in my markdown file.

Is this possible? and can this also be achieved by specifying global variables in the docfx.json file?

Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.