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

feat: Allow packages to define custom documentation URL and badge #147

Merged
merged 3 commits into from
May 21, 2024

Conversation

m5ka
Copy link
Contributor

@m5ka m5ka commented Apr 26, 2024

Background

Sally works great in the typical Go documentation ecosystem but when deviating from this it becomes difficult for the documentation badge/URL to be useful, even when specifying a custom godoc.host config variable.

This pull request aims to give a little more freedom with defining the documentation URL and badge image for different packages.

Changes

  • Adds doc_url and doc_badge variables to YAML documentation.
  • Honours the doc_url variable when the documentation URL is used in templates, though still generating the https://{godoc_host}/{module} URL as a default.
  • Honours the doc_badge variable as the image to use for a package's badge on the index page, though still generating the //pkg.go.dev/badge/{module}.svg URL as a default.
  • Adds tests for the above two changes (in handler_test.go).

This is a non-breaking feature (semver minor) change. Existing sally setups will continue to work as expected due to these defaults.

@CLAassistant
Copy link

CLAassistant commented Apr 26, 2024

CLA assistant check
All committers have signed the CLA.

@JacobOaks
Copy link
Contributor

Thanks for the PR! I think this LGTM, but I'll wait for another reviewer since I'm newer to Sally.

@r-hang r-hang merged commit d9a9a90 into uber-go:master May 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants