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
x/pkgsite: missing anchors for "source files" and "directories" on a package page #45210
Comments
It seems that this has changed to https://pkg.go.dev/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm#section-directories |
thanks for the info. |
the change from |
Package pages that contain files and directories are missing the paragraph symbol / anchor next to them. Add this symbol / anchor to allow linking to the tags that have the "section-sourcefiles" and "section-directories" ids. Fixes golang/go#45210
Change https://golang.org/cl/304649 mentions this issue: |
sent a PR for this here: instead of pinning to the anchors to the new IDs, it might be a good idea to preserve the backwards compatibility and rename the IDs too. the diff for that would look like: diff --git a/content/static/html/helpers/_unit_directories.tmpl b/content/static/html/helpers/_unit_directories.tmpl
index 3047e7b9..6d3d6a58 100644
--- a/content/static/html/helpers/_unit_directories.tmpl
+++ b/content/static/html/helpers/_unit_directories.tmpl
@@ -6,8 +6,9 @@
{{define "unit_directories"}}
<div class="UnitDirectories js-unitDirectories">
- <h2 class="UnitDirectories-title" id="section-directories">
+ <h2 class="UnitDirectories-title" id="pkg-subdirectories">
<img height="25px" width="20px" src="/static/img/pkg-icon-folder_20x16.svg" alt="">Directories
+ <a class="Documentation-idLink" href="#pkg-subdirectories">¶</a>
</h2>
<div class="UnitDirectories-expandButton js-expandAllDirectories">
<button>Expand all</button>
diff --git a/content/static/html/helpers/_unit_files.tmpl b/content/static/html/helpers/_unit_files.tmpl
index 568c06f5..67c600f2 100644
--- a/content/static/html/helpers/_unit_files.tmpl
+++ b/content/static/html/helpers/_unit_files.tmpl
@@ -6,8 +6,9 @@
{{define "unit_files"}}
<div class="UnitFiles js-unitFiles">
- <h2 class="UnitFiles-title" id="section-sourcefiles">
+ <h2 class="UnitFiles-title" id="pkg-sourcefiles">
<img height="16px" width="12px" src="/static/img/pkg-icon-file_16x12.svg" alt="">Source Files
+ <a class="Documentation-idLink" href="#pkg-sourcefiles">¶</a>
</h2>
<div class="UnitFiles-titleLink">
<a href="{{.SourceURL}}" target="_blank" rel="noopener">View all</a> NOTE: i don't know what was the old ID for source files, was it |
Package pages are missing the paragraph symbol / anchor for some items. Add this symbol / anchor to allow linking to the tags that have the "section-sourcefiles", "section-directories", "section-readme", "section-documentation" ids. Fixes golang/go#45210
i could no find existing tickets for this. sorry if a dup.
What is the URL of the page with the issue?
https://pkg.go.dev/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm
What is your user agent?
Screenshot
NONE
What did you do?
reproduction steps:
What did you expect to see?
anchors ( ¶ ) over the "Source files" and "Directories" sections for a certain package page.
NOTE: this was possible with the previous design of the go doc website.
the anchor for directories was
#pkg-subdirectories
What did you see instead?
no anchors.
The text was updated successfully, but these errors were encountered: