Skip to content
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: support custom links #42968

Closed
jba opened this issue Dec 3, 2020 · 6 comments
Closed

x/pkgsite: support custom links #42968

jba opened this issue Dec 3, 2020 · 6 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite

Comments

@jba
Copy link
Contributor

jba commented Dec 3, 2020

We want users to have the ability to share information about their packages that is currently unavailable on pkg.go.dev. We’ll extract this information in two separate ways, one for arbitrary units and one for packages. (A unit is a module, package or directory.)

If a unit's README contains a header called “Links” at any level, we will extract the top-level links [title](url) inside lists from the first such section and display them on the right sidenav.

We would extract both links from

#### Links

- [Title](URL)

- [Title](URL)

but neither from

#### Links

I recommend [Title](URL) for a good tutorial and [Title](URL) for reference documentation.

For package documentation, we will allow users to add a “Links” section to the package overview, and provide links in the format:

- Title, URL

Links will be displayed in the right sidebar in the order they are listed. Module-level links will be displayed first, then package-level links.

The links from a unit’s README will be displayed on that unit’s page and the pages of all sub-units, unless a sub-unit has a README links section of its own.

The links section will be removed from the documentation section of the godoc.

@jba jba added the pkgsite label Dec 3, 2020
@jba jba added this to the pkgsite/godoc.org-redirect milestone Dec 3, 2020
@jba jba self-assigned this Dec 3, 2020
@Delta456
Copy link

Delta456 commented Dec 3, 2020

This looks awesome, can't wait

@julieqiu julieqiu added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 3, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/274958 mentions this issue: internal/frontend: display godoc links

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/274957 mentions this issue: internal/frontend: display readme links

gopherbot pushed a commit to golang/pkgsite that referenced this issue Dec 3, 2020
Add the links in the "Links" section of the unit's README
to the right sidenav.

For golang/go#42968

Change-Id: Ie3744812af12ba365cd7863af09299d4d5c336a6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274957
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Dec 3, 2020
Display the links from the godoc "Links" section in the right sidebar.

For golang/go#42968

Change-Id: Ibf21a74133e10ed4c7b5a310e85999f590938c6a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274958
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/275276 mentions this issue: internal/frontend: show module readme links in sub-units

@jba
Copy link
Contributor Author

jba commented Dec 4, 2020

Instead of

The links from a unit’s README will be displayed on that unit’s page and the pages of all sub-units, unless a sub-unit has a README links section of its own

we are going to display the module's links on all sub-unit pages, in addition to the readme and doc links of that sub-unit. There won't be any general "inheritance" of links.

gopherbot pushed a commit to golang/pkgsite that referenced this issue Dec 7, 2020
Show a module's README links on all units within the module.

For golang/go#42968

Change-Id: I8701a04a16e1dd766b1b23ce12d52d01190840fd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275276
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
codyoss added a commit to googleapis/google-cloud-go that referenced this issue Dec 8, 2020
These links will eventually be surfaced on pkg.go.dev.

Related: golang/go#42968
@jba
Copy link
Contributor Author

jba commented Dec 8, 2020

This feature is live. You can see it at https://pkg.go.dev/github.com/jba/links.

@jba jba closed this as completed Dec 8, 2020
@golang golang locked and limited conversation to collaborators Jan 6, 2022
@rsc rsc unassigned jba Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants
@julieqiu @gopherbot @jba @Delta456 and others