Conversation
|
InstanceName doesn't always have to be the best option for the page title. How about creating a new property, PageTitle? I think it's cleaner. |
nikicat
added a commit
to nikicat/echo-swagger
that referenced
this pull request
Jun 5, 2026
Replace the hardcoded `<title>Swagger UI</title>` with a configurable
`Title` config field, settable through a new `Title(...)` option. Defaults
to "Swagger UI", preserving the existing page title when unset.
This supersedes the `{{.InstanceName}} | Swagger UI` approach: a dedicated
field is cleaner (per review feedback on swaggo#119) and avoids regressing the
default title to "swagger | Swagger UI" for users who don't set an
instance name.
Related to swaggo#115
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
@svachaj good point — reworked accordingly. Instead of reusing |
Replace the hardcoded `<title>Swagger UI</title>` with a configurable
`Title` config field, settable through a new `Title(...)` option. Defaults
to "Swagger UI", preserving the existing page title when unset.
This supersedes the `{{.InstanceName}} | Swagger UI` approach: a dedicated
field is cleaner (per review feedback on swaggo#119) and avoids regressing the
default title to "swagger | Swagger UI" for users who don't set an
instance name.
Related to swaggo#115
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the Swagger UI HTML page title configurable.
Adds a
Titleconfig field and aTitle(...)functional option. It defaults to"Swagger UI", so the page title is unchanged unless explicitly set:This replaces the earlier
{{.InstanceName}} | Swagger UIapproach. A dedicated field is cleaner (per @svachaj's review feedback) and avoids regressing the default title toswagger | Swagger UIfor users who don't set an instance name.Related to #115