feat(pages): add customizable section labels for landing pages
Adds ability to customize section headings on repository landing pages. Users can now override default labels for value propositions and features sections. New fields: - LabelValueProps: Custom heading for value propositions section (default: "Why choose us") - LabelFeatures: Custom heading for features section (default: "Capabilities") Useful for branding consistency or localization when default English headings don't fit the project's tone or language.
This commit is contained in:
@@ -4545,6 +4545,12 @@
|
||||
"repo.settings.pages.nav_show_repository": "Show Repository link (View Source button)",
|
||||
"repo.settings.pages.nav_show_releases": "Show Releases link",
|
||||
"repo.settings.pages.nav_show_issues": "Show Issues link",
|
||||
"repo.settings.pages.section_labels": "Section Labels",
|
||||
"repo.settings.pages.section_labels_desc": "Customize the headings shown on your landing page for each section",
|
||||
"repo.settings.pages.label_value_props": "Value Props Heading",
|
||||
"repo.settings.pages.label_value_props_help": "Heading for the value propositions section (e.g., \"Why choose us\")",
|
||||
"repo.settings.pages.label_features": "Features Heading",
|
||||
"repo.settings.pages.label_features_help": "Heading for the features section (e.g., \"Capabilities\")",
|
||||
"repo.settings.pages.blog_section": "Blog Section",
|
||||
"repo.settings.pages.blog_enabled_desc": "Show recent blog posts on the landing page",
|
||||
"repo.settings.pages.blog_headline": "Blog Headline",
|
||||
|
||||
@@ -479,6 +479,12 @@ func PagesContentPost(ctx *context.Context) {
|
||||
config.Advanced.HideMobileReleases = ctx.FormBool("hide_mobile_releases")
|
||||
config.Advanced.GooglePlayID = strings.TrimSpace(ctx.FormString("google_play_id"))
|
||||
config.Advanced.AppStoreID = strings.TrimSpace(ctx.FormString("app_store_id"))
|
||||
if v := ctx.FormString("label_value_props"); v != "" {
|
||||
config.Navigation.LabelValueProps = v
|
||||
}
|
||||
if v := ctx.FormString("label_features"); v != "" {
|
||||
config.Navigation.LabelFeatures = v
|
||||
}
|
||||
config.Navigation.ShowDocs = ctx.FormBool("nav_show_docs")
|
||||
config.Navigation.ShowAPI = ctx.FormBool("nav_show_api")
|
||||
config.Navigation.ShowRepository = ctx.FormBool("nav_show_repository")
|
||||
|
||||
@@ -37,6 +37,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.section_labels"}}</h5>
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.section_labels_desc"}}</p>
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.pages.label_value_props"}}</label>
|
||||
<input name="label_value_props" value="{{.Config.Navigation.LabelValueProps}}" placeholder="Why choose us">
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.label_value_props_help"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.pages.label_features"}}</label>
|
||||
<input name="label_features" value="{{.Config.Navigation.LabelFeatures}}" placeholder="Capabilities">
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.label_features_help"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.public_releases"}}</h5>
|
||||
<div class="inline field">
|
||||
<div class="ui toggle checkbox">
|
||||
|
||||
Reference in New Issue
Block a user