Skip to content

Custom template not applied when specified in docfx.json #1821

Description

@RobDaPraia

Custom template not applied when specified in docfx.json

Applying a custom template works when used a parameter from command line, but does not work when specified in docfx.json configuration file.

Functional impact

In automatic build have to specify command line parameters instead of using the configuration file

Minimal repro steps

See attached docfx project, we try to add the Application Insights JavaScript snipped to the head of the html.

DocFx.zip

OK

docfx -t default,templates\mytemplate

NOK

docfx docfx-custom-template.json

Expected result

The JavaScript snippet from templates\mytemplate\partials\head.tmpl.partial to be included in the html

Actual result

Custom template is not applied when setting the template in the docfx configuration file

Further technical details

the custom template is specified in the docfx-custom-template.json as follow, see attached docfx project:

  "build": {
  "template": [
        "default",
        "templates/mytemplate"
    ],
    "content": [
      {
        "files": [
          "api/**.yml",
          "api/index.md",
          "api-vb/**.yml"
        ]
      },
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions