diff --git a/routers/web/repo/setting/pages.go b/routers/web/repo/setting/pages.go index 2eece73754..d74bc91a69 100644 --- a/routers/web/repo/setting/pages.go +++ b/routers/web/repo/setting/pages.go @@ -41,6 +41,7 @@ func Pages(ctx *context.Context) { // Generate subdomain ctx.Data["PagesSubdomain"] = pages_service.GetPagesSubdomain(ctx.Repo.Repository) + ctx.Data["PagesURL"] = pages_service.GetPagesURL(ctx.Repo.Repository) // Available templates ctx.Data["PagesTemplates"] = []string{"simple", "documentation", "product", "portfolio"} diff --git a/services/pages/pages.go b/services/pages/pages.go index f10580353d..873f450762 100644 --- a/services/pages/pages.go +++ b/services/pages/pages.go @@ -180,8 +180,9 @@ func GetPagesSubdomain(repo *repo_model.Repository) string { func GetPagesURL(repo *repo_model.Repository) string { subdomain := GetPagesSubdomain(repo) // This should be configurable - pagesDomain := setting.AppURL // TODO: Add proper pages domain setting - return fmt.Sprintf("https://%s.pages.%s", subdomain, pagesDomain) + // Extract domain from settings + domain := setting.Domain + return fmt.Sprintf("https://%s.pages.%s", subdomain, domain) } // GetPagesDomains returns all custom domains for a repository's pages diff --git a/templates/repo/settings/pages.tmpl b/templates/repo/settings/pages.tmpl index 9fa8fb0f7a..976e694c2d 100644 --- a/templates/repo/settings/pages.tmpl +++ b/templates/repo/settings/pages.tmpl @@ -8,7 +8,7 @@