diff --git a/routers/web/pages/pages.go b/routers/web/pages/pages.go index e2dadde9c3..9f4285dcec 100644 --- a/routers/web/pages/pages.go +++ b/routers/web/pages/pages.go @@ -137,6 +137,11 @@ func getRepoFromRequest(ctx *context.Context) (*repo_model.Repository, *pages_mo // setupLandingPageContext sets up the shared template context data used by both // the landing page and blog views (nav, footer, logo, repo info, etc.) func setupLandingPageContext(ctx *context.Context, repo *repo_model.Repository, config *pages_module.LandingConfig) { + // Ensure Owner is loaded — templates access .Repository.Owner.Name + if err := repo.LoadOwner(ctx); err != nil { + log.Error("Failed to load repo owner for pages: %v", err) + } + ctx.Data["Repository"] = repo ctx.Data["Config"] = config if ctx.Data["Title"] == nil || ctx.Data["Title"] == "" {