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: images in README.md do not appear #44032

Closed
robpike opened this issue Feb 1, 2021 · 3 comments
Closed

x/pkgsite: images in README.md do not appear #44032

robpike opened this issue Feb 1, 2021 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite

Comments

@robpike
Copy link
Contributor

robpike commented Feb 1, 2021

Possibly related to #43325.

If you look at github.com/robpike/ivy, you'll see an image at the bottom of the README.

At pkg.go.dev/robpike.io/ivy, the text appears but the image is replaced by the "broken image" icon and the alternate text.

I can think of various reasons this could be happening, including the custom domain, but I thought it worth reporting.

@gopherbot gopherbot added this to the Unreleased milestone Feb 1, 2021
@fzipp
Copy link
Contributor

fzipp commented Feb 1, 2021

The broken image source URL is

https://github.com/robpike/ivy.git/raw/v0.1.0/ivy.jpg

but it should be

https://github.com/robpike/ivy/raw/v0.1.0/ivy.jpg

Pkgsite tries to convert a relative markdown image URL to an absolute URL by prepending the repository URL, but for some reason the repository URL ends in ".git", as can be seen in the repository link on the right side of the page. Probably because the "go-import" meta tag under https://robpike.io/ivy?go-get=1 ends in ".git":

<meta name="go-import" content="robpike.io/ivy git https://github.com/robpike/ivy.git">

https://golang.org/cmd/go/#hdr-Remote_import_paths says:

"The meta tag has the form:

<meta name="go-import" content="import-prefix vcs repo-root">

The repo-root is the root of the version control system containing a scheme and not containing a .vcs qualifier."

@jba jba self-assigned this Feb 1, 2021
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Feb 1, 2021
@jba jba added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 1, 2021
@gopherbot
Copy link

Change https://golang.org/cl/288612 mentions this issue: internal/source: trim .git suffix from repo URLs

@jba
Copy link
Contributor

jba commented Feb 2, 2021

Thanks for the accurate diagnosis, @fzipp.

The .git also broke source links.

We deploy daily so this should be live by tomorrow.

@golang golang locked and limited conversation to collaborators Feb 2, 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

4 participants