dotnet / dotnet/docfx

[Bug] Referencing globalMetadata in .md files

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

Description

**Describe the bug**
References to globalMetadata, fileMetadata and YAML front matter are not resolving.

**To Reproduce**
Steps to reproduce the behavior:
1. Minimal example:
docfx.json and index.md are located in the same folder.
docfx.json
```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
"build": {
"content": [
{
"files": ["**/*.md"],
"src": "."
}
],
"resource": [
{
"files": ["images/**"]
}
],
"output": "_site",
"fileMetadata": {
"author": {
"**.md": "123123",
"spec/**.md": 3
}
},
"globalMetadata": {
"_appTitle": "Sample App",
"injection": "abc"
}
}
}
```

index.md
```md
---
_layout: landing
---

# This is the **HOMEPAGE**. **{{_layout}}**

{{author}}

- Global `injection`: **{{injection}}**
- Global `_appTitle`: **{{_appTitle}}**
```

**Expected behavior**
I expected {{injection}} to be rendered as `abc` etc.

**Context (please complete the following information):**
- OS: Windows 11
- Docfx version: 2.78.2+3ff9ae7a9700029e0023a7ece18a723d351f1e9b

**Additional context**
Add any other context about the problem here.

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.