x/pkgsite: subdirectories are missing for nested modules #38596
What is the URL of the page with the issue?
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
What did you expect to see?
I don't see a link to the same under the subdirectories tab from pkg.go.dev.
What did you see instead?
The list of subdirectories does not include storage.
The text was updated successfully, but these errors were encountered:
Thanks for the feedback! The reason storage is not listed there is because cloud.google.com/go/storage is a nested module:
This means that it is not a subdirectory of cloud.google.com/go. When you download cloud.google.com/go via proxy.golang.org (https://proxy.golang.org/cloud.google.com/go/@v/v0.56.0.zip), you will notice that it is not there.
We understand that this is confusing from a UI perspective and plan to address it in the upcoming round of design changes.
Thanks for the explanation, @julieqiu. I see that the old documentation is actually misleading in this case.
I wonder if it would help if the UI were explicit about packages and nested modules instead of using "subdirectories" to describe these things. I don’t know if "nested" is a formal class of modules, but it would help clarify what you get when installing a module (packages) vs. what you need to install separately (modules that may share part of the same path).
Hey there! We’re planning to add nested modules to the bottom of the subdirectories page. For example, https://pkg.go.dev/cloud.google.com/go?tab=subdirectories will show:
This change creates a function in the DataSource interface that retrieves the nested modules as ModuleInfos given a path to a directory. Note that proxydatasource is included since it is required to fill the datasource interface but only returns an empty slice since we are not implementing the functionality there. This change also adds a scanModuleInfo helper function for scanning ModuleInfo from the db. Updates golang/go#38596 Change-Id: I02f25aad2640a0828e58d622d1c8661e6a303b84 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253742 Reviewed-by: Julie Qiu <firstname.lastname@example.org>
This change adds NestedModules to the directory struct in order to later render the data in the subdirectories page of a package. We also modify the createDirectory function to take in a nestedModules parameter. Updates golang/go#38596 Change-Id: I9bcfc1f2aa37ac0b03b5def4b237473310690af6 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254018 Reviewed-by: Jonathan Amsterdam <email@example.com> Reviewed-by: Julie Qiu <firstname.lastname@example.org>
…ectories page This change adds the HTML and CSS changes for the subdirectories template to include nested modules in the table with a modules badge. This includes adding a --light-blue CSS variable to reflect the blue background of the modules badge. This change also deletes the _directories.tmpl helper template so that iterating through the packages and nested modules in the HTML table is a lot clearer. before/after images: https://photos.app.goo.gl/2reDtNHxThVnDMiL9 Updates golang/go#38596 Change-Id: Id1dad1ba3a28881a203bf90afe1d5372ede2317c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254019 Reviewed-by: Julie Qiu <email@example.com> Reviewed-by: Jonathan Amsterdam <firstname.lastname@example.org> Reviewed-by: Jamal Carvalho <email@example.com>