diff --git a/internal/godocfx/parse.go b/internal/godocfx/parse.go index fb44d93e2d1..64628591e0d 100644 --- a/internal/godocfx/parse.go +++ b/internal/godocfx/parse.go @@ -339,9 +339,16 @@ func buildTOC(mod string, pis []pkgInfo, extraFiles []extraFile) tableOfContents toc := tableOfContents{} modTOC := &tocItem{ - UID: mod, // Assume the module root has a package. + UID: mod, Name: mod, } + + // Assume the module root has a package. + modTOC.addItem(&tocItem{ + UID: mod, + Name: mod, + }) + for _, ef := range extraFiles { modTOC.addItem(&tocItem{ Href: ef.dstRelativePath, diff --git a/internal/godocfx/testdata/golden/toc.yml b/internal/godocfx/testdata/golden/toc.yml index 4e31bd65dbb..051e663c432 100644 --- a/internal/godocfx/testdata/golden/toc.yml +++ b/internal/godocfx/testdata/golden/toc.yml @@ -2,5 +2,7 @@ - uid: cloud.google.com/go/storage name: cloud.google.com/go/storage items: + - uid: cloud.google.com/go/storage + name: cloud.google.com/go/storage - name: README href: pkg-readme.md