File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -698,6 +698,8 @@ func Home(ctx *context.Context) {
698
698
return
699
699
}
700
700
701
+ ctx .Data ["FeedURL" ] = ctx .Repo .Repository .HTMLURL ()
702
+
701
703
checkHomeCodeViewable (ctx )
702
704
if ctx .Written () {
703
705
return
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ func Profile(ctx *context.Context) {
75
75
}
76
76
77
77
uname , showFeedType := feed .GetFeedType (uname , ctx .Req )
78
+ isShowFeed := len (showFeedType ) != 0
78
79
79
80
ctxUser := GetUserByName (ctx , uname )
80
81
if ctx .Written () {
@@ -83,7 +84,7 @@ func Profile(ctx *context.Context) {
83
84
84
85
if ctxUser .IsOrganization () {
85
86
// Show Org RSS feed
86
- if len ( showFeedType ) != 0 {
87
+ if isShowFeed {
87
88
feed .ShowUserFeed (ctx , ctxUser , showFeedType )
88
89
return
89
90
}
@@ -111,11 +112,14 @@ func Profile(ctx *context.Context) {
111
112
}
112
113
113
114
// Show User RSS feed
114
- if len ( showFeedType ) != 0 {
115
+ if isShowFeed {
115
116
feed .ShowUserFeed (ctx , ctxUser , showFeedType )
116
117
return
117
118
}
118
119
120
+ // advertise feed via meta tag
121
+ ctx .Data ["FeedURL" ] = ctxUser .HTMLURL ()
122
+
119
123
// Show OpenID URIs
120
124
openIDs , err := user_model .GetUserOpenIDs (ctxUser .ID )
121
125
if err != nil {
Original file line number Diff line number Diff line change 14
14
{{if .GoGetImport}}
15
15
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
16
16
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
17
+ {{end}}
18
+ {{if .FeedURL}}
19
+ <link rel="alternate" type="application/atom+xml" title="" href="{{.FeedURL}}.atom">
20
+ <link rel="alternate" type="application/rss+xml" title="" href="{{.FeedURL}}.rss">
17
21
{{end}}
18
22
<script>
19
23
<!-- /* eslint-disable */ -->
You can’t perform that action at this time.
0 commit comments