I am trying to create a DocFx template, using its support for moustache.
I'd like to be able to generate a site menu, in the navbar of all the generated html pages, based on a toc.yml file in the project root.
I know that the default template does this. But it apparently does so by converting the toc.yml to a standalone html file, which is then parsed by javascript in the conceptual html files to load the menu.
I'd like to be able to do that directly within the moustache file which creates the conceptual html files.
I created this partial (toc.tmpl.partial), and called it in the appropriate part of the conceptual moustache file:
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
<div class="sidenav">
this is sidenav!
{{#items}}
hello!
{{/items}}
</div>
But, unfortunately, nothing within the {{items}} tags gets generated.
Yet if I use the same code in toc.tmpl, an html file with the appropriate number of hello! lines is produced.
So I'm missing something basic about the way the pieces of DocFx work together.
Here's my simple conceptual file generator:
{{!include(/^styles/.*/)}}
{{!include(/^fonts/.*/)}}
{{!include(favicon.ico)}}
{{!include(logo.svg)}}
{{!include(search-stopwords.json)}}
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
{{>partials/head}}
<body data-spy="scroll" data-target="#affix">
{{>partials/navbar}}
<div style="position: relative; margin-top: 5px;">
<div class="toc-column" style="position: fixed;">
{{>partials/toc}}
</div>
<div style="position: fixed; left: 160px;" data-uid="{{uid}}">
{{{rawTitle}}}
{{{conceptual}}}
</div>
</div>
{{^_disableFooter}}
{{>partials/footer}}
{{/_disableFooter}}
{{>partials/scripts}}
</body>
</html>