@@ -26,6 +26,11 @@ type RSSService struct {
26
26
Store * store.Store
27
27
}
28
28
29
+ type RSSHeading struct {
30
+ Title string
31
+ Description string
32
+ }
33
+
29
34
func NewRSSService (profile * profile.Profile , store * store.Store ) * RSSService {
30
35
return & RSSService {
31
36
Profile : profile ,
@@ -93,10 +98,14 @@ func (s *RSSService) GetUserRSS(c echo.Context) error {
93
98
}
94
99
95
100
func (s * RSSService ) generateRSSFromMemoList (ctx context.Context , memoList []* store.Memo , baseURL string ) (string , error ) {
101
+ rssHeading , err := getRSSHeading (s .Store , ctx )
102
+ if err != nil {
103
+ return "" , err
104
+ }
96
105
feed := & feeds.Feed {
97
- Title : "Memos" ,
106
+ Title : rssHeading . Title ,
98
107
Link : & feeds.Link {Href : baseURL },
99
- Description : "An open source, lightweight note-taking service. Easily capture and share your great thoughts." ,
108
+ Description : rssHeading . Description ,
100
109
Created : time .Now (),
101
110
}
102
111
@@ -150,3 +159,21 @@ func getRSSItemDescription(content string) (string, error) {
150
159
result := renderer .NewHTMLRenderer ().Render (nodes )
151
160
return result , nil
152
161
}
162
+
163
+ func getRSSHeading (store * store.Store , ctx context.Context ) (RSSHeading , error ) {
164
+ settings , err := store .GetWorkspaceGeneralSetting (ctx )
165
+ if err != nil {
166
+ return RSSHeading {}, err
167
+ }
168
+ if settings == nil || settings .CustomProfile == nil {
169
+ return RSSHeading {
170
+ Title : "Memos" ,
171
+ Description : "An open source, lightweight note-taking service. Easily capture and share your great thoughts." ,
172
+ }, nil
173
+ }
174
+ customProfile := settings .CustomProfile
175
+ return RSSHeading {
176
+ Title : customProfile .Title ,
177
+ Description : customProfile .Description ,
178
+ }, nil
179
+ }
0 commit comments