Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Setting outputFileName has no effect when set inside fileMetadata #9776

Open
glopesdev opened this issue Mar 9, 2024 · 1 comment
Open
Labels
bug A bug to fix static-site Produce static HTML output ready for publishing to hosts like GitHub pages

Comments

@glopesdev
Copy link

glopesdev commented Mar 9, 2024

Describe the bug
The file metadata supports outputFileName as a way to indicate the desired file name of a specific document. For example the following YAML metadata can be indicated at the top of a README.md file to make sure the result is emitted as index.html.

---
outputFileName: index.html
---

Since outputFileName is part of file metadata, one would expect it to be possible to specify it as part of the fileMetadata section in docfx.json, similar to other metadata entries.

Unfortunately, the below doesn't seem to work:

  "build": {
    "fileMetadata": {
      "_appTitle": {
        "**/README.md": "index title"
      },
      "outputFileName": {
        "**/README.md": "index.html"
      }
    }
  }

In this case, _appTitle is applied successfully (only README.md files will have the custom title) but files will still be named README.html.

Expected behavior
All README.md files should be exported as index.html files.

Context (please complete the following information):

  • OS: Windows
  • Docfx version: 2.75.3
@glopesdev glopesdev added the bug A bug to fix label Mar 9, 2024
@filzrev
Copy link
Contributor

filzrev commented Mar 11, 2024

I'm also facing similar problems before that documentType metadata is not applied when specified by fileMetadata.

For consistent behavior.
'documentType' and 'outputFileName' metadata should be overridable by 'fileMetadata' configurations.

Similar issues are discussed before at #1310 (comment).

@yufeih yufeih added the static-site Produce static HTML output ready for publishing to hosts like GitHub pages label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix static-site Produce static HTML output ready for publishing to hosts like GitHub pages
Projects
None yet
Development

No branches or pull requests

3 participants