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

User/Org Feed render description as per web #23887

Merged
merged 6 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT


//go:build vendor

package main
Expand Down
16 changes: 15 additions & 1 deletion routers/web/feed/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (

activities_model "code.gitea.io/gitea/models/activities"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/markup/markdown"

"github.com/gorilla/feeds"
)
Expand Down Expand Up @@ -39,10 +41,22 @@ func showUserFeed(ctx *context.Context, formatType string) {
return
}

ctxUserDescription, err := markdown.RenderString(&markup.RenderContext{
Ctx: ctx,
URLPrefix: ctx.ContextUser.HTMLURL(),
Metas: map[string]string{
"user": ctx.ContextUser.GetDisplayName(),
},
}, ctx.ContextUser.Description)
if err != nil {
ctx.ServerError("RenderString", err)
return
}

feed := &feeds.Feed{
Title: ctx.Tr("home.feed_of", ctx.ContextUser.DisplayName()),
Link: &feeds.Link{Href: ctx.ContextUser.HTMLURL()},
Description: ctx.ContextUser.Description,
Description: ctxUserDescription,
Created: time.Now(),
}

Expand Down