Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
2b7bd47b
Commit
2b7bd47b
authored
Jan 29, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rss routes
parent
54c5039d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
93 deletions
+64
-93
resource.go
api/resource/resource.go
+5
-5
rss.go
api/rss/rss.go
+49
-79
v1.go
api/v1/v1.go
+6
-5
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-2
UserProfile.tsx
web/src/pages/UserProfile.tsx
+1
-1
No files found.
api/resource/resource.go
View file @
2b7bd47b
...
@@ -30,24 +30,24 @@ const (
...
@@ -30,24 +30,24 @@ const (
thumbnailImagePath
=
".thumbnail_cache"
thumbnailImagePath
=
".thumbnail_cache"
)
)
type
Service
struct
{
type
Resource
Service
struct
{
Profile
*
profile
.
Profile
Profile
*
profile
.
Profile
Store
*
store
.
Store
Store
*
store
.
Store
}
}
func
New
Service
(
profile
*
profile
.
Profile
,
store
*
store
.
Store
)
*
Service
{
func
New
ResourceService
(
profile
*
profile
.
Profile
,
store
*
store
.
Store
)
*
Resource
Service
{
return
&
Service
{
return
&
Resource
Service
{
Profile
:
profile
,
Profile
:
profile
,
Store
:
store
,
Store
:
store
,
}
}
}
}
func
(
s
*
Service
)
RegisterResourcePublic
Routes
(
g
*
echo
.
Group
)
{
func
(
s
*
ResourceService
)
Register
Routes
(
g
*
echo
.
Group
)
{
g
.
GET
(
"/r/:resourceName"
,
s
.
streamResource
)
g
.
GET
(
"/r/:resourceName"
,
s
.
streamResource
)
g
.
GET
(
"/r/:resourceName/*"
,
s
.
streamResource
)
g
.
GET
(
"/r/:resourceName/*"
,
s
.
streamResource
)
}
}
func
(
s
*
Service
)
streamResource
(
c
echo
.
Context
)
error
{
func
(
s
*
Resource
Service
)
streamResource
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
ctx
:=
c
.
Request
()
.
Context
()
resourceName
:=
c
.
Param
(
"resourceName"
)
resourceName
:=
c
.
Param
(
"resourceName"
)
resource
,
err
:=
s
.
Store
.
GetResource
(
ctx
,
&
store
.
FindResource
{
resource
,
err
:=
s
.
Store
.
GetResource
(
ctx
,
&
store
.
FindResource
{
...
...
api/
v1
/rss.go
→
api/
rss
/rss.go
View file @
2b7bd47b
package
v1
package
rss
import
(
import
(
"context"
"context"
"encoding/json"
"net/http"
"net/http"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -10,12 +9,12 @@ import (
...
@@ -10,12 +9,12 @@ import (
"github.com/gorilla/feeds"
"github.com/gorilla/feeds"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4"
"github.com/usememos/gomark"
"github.com/usememos/gomark/ast"
"github.com/usememos/gomark/ast"
"github.com/usememos/gomark/parser"
"github.com/usememos/gomark/parser/tokenizer"
"github.com/usememos/gomark/renderer"
"github.com/usememos/gomark/renderer"
"github.com/usememos/memos/internal/util"
"github.com/usememos/memos/internal/util"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store"
)
)
...
@@ -24,26 +23,25 @@ const (
...
@@ -24,26 +23,25 @@ const (
maxRSSItemTitleLength
=
128
maxRSSItemTitleLength
=
128
)
)
func
(
s
*
APIV1Service
)
registerRSSRoutes
(
g
*
echo
.
Group
)
{
type
RSSService
struct
{
g
.
GET
(
"/explore/rss.xml"
,
s
.
GetExploreRSS
)
Profile
*
profile
.
Profile
g
.
GET
(
"/u/:id/rss.xml"
,
s
.
GetUserRSS
)
Store
*
store
.
Store
}
}
// GetExploreRSS godoc
func
NewRSSService
(
profile
*
profile
.
Profile
,
store
*
store
.
Store
)
*
RSSService
{
//
return
&
RSSService
{
// @Summary Get RSS
Profile
:
profile
,
// @Tags rss
Store
:
store
,
// @Produce xml
// @Success 200 {object} nil "RSS"
// @Failure 500 {object} nil "Failed to get system customized profile | Failed to find memo list | Failed to generate rss"
// @Router /explore/rss.xml [GET]
func
(
s
*
APIV1Service
)
GetExploreRSS
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
systemCustomizedProfile
,
err
:=
s
.
getSystemCustomizedProfile
(
ctx
)
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to get system customized profile"
)
.
SetInternal
(
err
)
}
}
}
func
(
s
*
RSSService
)
RegisterRoutes
(
g
*
echo
.
Group
)
{
g
.
GET
(
"/explore/rss.xml"
,
s
.
GetExploreRSS
)
g
.
GET
(
"/u/:username/rss.xml"
,
s
.
GetUserRSS
)
}
func
(
s
*
RSSService
)
GetExploreRSS
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
normalStatus
:=
store
.
Normal
normalStatus
:=
store
.
Normal
memoFind
:=
store
.
FindMemo
{
memoFind
:=
store
.
FindMemo
{
RowStatus
:
&
normalStatus
,
RowStatus
:
&
normalStatus
,
...
@@ -55,7 +53,7 @@ func (s *APIV1Service) GetExploreRSS(c echo.Context) error {
...
@@ -55,7 +53,7 @@ func (s *APIV1Service) GetExploreRSS(c echo.Context) error {
}
}
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
rss
,
err
:=
s
.
generateRSSFromMemoList
(
ctx
,
memoList
,
baseURL
,
systemCustomizedProfile
)
rss
,
err
:=
s
.
generateRSSFromMemoList
(
ctx
,
memoList
,
baseURL
)
if
err
!=
nil
{
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
}
}
...
@@ -63,31 +61,22 @@ func (s *APIV1Service) GetExploreRSS(c echo.Context) error {
...
@@ -63,31 +61,22 @@ func (s *APIV1Service) GetExploreRSS(c echo.Context) error {
return
c
.
String
(
http
.
StatusOK
,
rss
)
return
c
.
String
(
http
.
StatusOK
,
rss
)
}
}
// GetUserRSS godoc
func
(
s
*
RSSService
)
GetUserRSS
(
c
echo
.
Context
)
error
{
//
// @Summary Get RSS for a user
// @Tags rss
// @Produce xml
// @Param id path int true "User ID"
// @Success 200 {object} nil "RSS"
// @Failure 400 {object} nil "User id is not a number"
// @Failure 500 {object} nil "Failed to get system customized profile | Failed to find memo list | Failed to generate rss"
// @Router /u/{id}/rss.xml [GET]
func
(
s
*
APIV1Service
)
GetUserRSS
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
ctx
:=
c
.
Request
()
.
Context
()
id
,
err
:=
util
.
ConvertStringToInt32
(
c
.
Param
(
"id"
))
username
:=
c
.
Param
(
"username"
)
user
,
err
:=
s
.
Store
.
GetUser
(
ctx
,
&
store
.
FindUser
{
Username
:
&
username
,
})
if
err
!=
nil
{
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
Status
BadRequest
,
"User id is not a numb
er"
)
.
SetInternal
(
err
)
return
echo
.
NewHTTPError
(
http
.
Status
InternalServerError
,
"Failed to find us
er"
)
.
SetInternal
(
err
)
}
}
if
user
==
nil
{
systemCustomizedProfile
,
err
:=
s
.
getSystemCustomizedProfile
(
ctx
)
return
echo
.
NewHTTPError
(
http
.
StatusNotFound
,
"User not found"
)
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to get system customized profile"
)
.
SetInternal
(
err
)
}
}
normalStatus
:=
store
.
Normal
normalStatus
:=
store
.
Normal
memoFind
:=
store
.
FindMemo
{
memoFind
:=
store
.
FindMemo
{
CreatorID
:
&
id
,
CreatorID
:
&
user
.
ID
,
RowStatus
:
&
normalStatus
,
RowStatus
:
&
normalStatus
,
VisibilityList
:
[]
store
.
Visibility
{
store
.
Public
},
VisibilityList
:
[]
store
.
Visibility
{
store
.
Public
},
}
}
...
@@ -97,7 +86,7 @@ func (s *APIV1Service) GetUserRSS(c echo.Context) error {
...
@@ -97,7 +86,7 @@ func (s *APIV1Service) GetUserRSS(c echo.Context) error {
}
}
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
rss
,
err
:=
s
.
generateRSSFromMemoList
(
ctx
,
memoList
,
baseURL
,
systemCustomizedProfile
)
rss
,
err
:=
s
.
generateRSSFromMemoList
(
ctx
,
memoList
,
baseURL
)
if
err
!=
nil
{
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
}
}
...
@@ -105,38 +94,41 @@ func (s *APIV1Service) GetUserRSS(c echo.Context) error {
...
@@ -105,38 +94,41 @@ func (s *APIV1Service) GetUserRSS(c echo.Context) error {
return
c
.
String
(
http
.
StatusOK
,
rss
)
return
c
.
String
(
http
.
StatusOK
,
rss
)
}
}
func
(
s
*
APIV1Service
)
generateRSSFromMemoList
(
ctx
context
.
Context
,
memoList
[]
*
store
.
Memo
,
baseURL
string
,
profile
*
CustomizedProfile
)
(
string
,
error
)
{
func
(
s
*
RSSService
)
generateRSSFromMemoList
(
ctx
context
.
Context
,
memoList
[]
*
store
.
Memo
,
baseURL
string
)
(
string
,
error
)
{
feed
:=
&
feeds
.
Feed
{
feed
:=
&
feeds
.
Feed
{
Title
:
profile
.
Name
,
Title
:
"Memos"
,
Link
:
&
feeds
.
Link
{
Href
:
baseURL
},
Link
:
&
feeds
.
Link
{
Href
:
baseURL
},
Description
:
profile
.
Description
,
Description
:
"An open source, lightweight note-taking service. Easily capture and share your great thoughts."
,
Created
:
time
.
Now
(),
Created
:
time
.
Now
(),
}
}
var
itemCountLimit
=
util
.
Min
(
len
(
memoList
),
maxRSSItemCount
)
var
itemCountLimit
=
util
.
Min
(
len
(
memoList
),
maxRSSItemCount
)
feed
.
Items
=
make
([]
*
feeds
.
Item
,
itemCountLimit
)
feed
.
Items
=
make
([]
*
feeds
.
Item
,
itemCountLimit
)
for
i
:=
0
;
i
<
itemCountLimit
;
i
++
{
for
i
:=
0
;
i
<
itemCountLimit
;
i
++
{
memoMessage
,
err
:=
s
.
convertMemoFromStore
(
ctx
,
memoList
[
i
])
memo
:=
memoList
[
i
]
if
err
!=
nil
{
description
,
err
:=
getRSSItemDescription
(
memo
.
Content
)
return
""
,
err
}
description
,
err
:=
getRSSItemDescription
(
memoMessage
.
Content
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
feed
.
Items
[
i
]
=
&
feeds
.
Item
{
feed
.
Items
[
i
]
=
&
feeds
.
Item
{
Title
:
getRSSItemTitle
(
memo
Message
.
Content
),
Title
:
getRSSItemTitle
(
memo
.
Content
),
Link
:
&
feeds
.
Link
{
Href
:
baseURL
+
"/m/"
+
memo
Message
.
Name
},
Link
:
&
feeds
.
Link
{
Href
:
baseURL
+
"/m/"
+
memo
.
Resource
Name
},
Description
:
description
,
Description
:
description
,
Created
:
time
.
Unix
(
memo
Message
.
CreatedTs
,
0
),
Created
:
time
.
Unix
(
memo
.
CreatedTs
,
0
),
}
}
if
len
(
memoMessage
.
ResourceList
)
>
0
{
resources
,
err
:=
s
.
Store
.
ListResources
(
ctx
,
&
store
.
FindResource
{
resource
:=
memoMessage
.
ResourceList
[
0
]
MemoID
:
&
memo
.
ID
,
})
if
err
!=
nil
{
return
""
,
err
}
if
len
(
resources
)
>
0
{
resource
:=
resources
[
0
]
enclosure
:=
feeds
.
Enclosure
{}
enclosure
:=
feeds
.
Enclosure
{}
if
resource
.
ExternalLink
!=
""
{
if
resource
.
ExternalLink
!=
""
{
enclosure
.
Url
=
resource
.
ExternalLink
enclosure
.
Url
=
resource
.
ExternalLink
}
else
{
}
else
{
enclosure
.
Url
=
baseURL
+
"/o/r/"
+
resource
.
Name
enclosure
.
Url
=
baseURL
+
"/o/r/"
+
resource
.
Resource
Name
}
}
enclosure
.
Length
=
strconv
.
Itoa
(
int
(
resource
.
Size
))
enclosure
.
Length
=
strconv
.
Itoa
(
int
(
resource
.
Size
))
enclosure
.
Type
=
resource
.
Type
enclosure
.
Type
=
resource
.
Type
...
@@ -151,29 +143,8 @@ func (s *APIV1Service) generateRSSFromMemoList(ctx context.Context, memoList []*
...
@@ -151,29 +143,8 @@ func (s *APIV1Service) generateRSSFromMemoList(ctx context.Context, memoList []*
return
rss
,
nil
return
rss
,
nil
}
}
func
(
s
*
APIV1Service
)
getSystemCustomizedProfile
(
ctx
context
.
Context
)
(
*
CustomizedProfile
,
error
)
{
systemSetting
,
err
:=
s
.
Store
.
GetSystemSetting
(
ctx
,
&
store
.
FindSystemSetting
{
Name
:
SystemSettingCustomizedProfileName
.
String
(),
})
if
err
!=
nil
{
return
nil
,
err
}
customizedProfile
:=
&
CustomizedProfile
{
Name
:
"Memos"
,
Locale
:
"en"
,
Appearance
:
"system"
,
}
if
systemSetting
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
systemSetting
.
Value
),
customizedProfile
);
err
!=
nil
{
return
nil
,
err
}
}
return
customizedProfile
,
nil
}
func
getRSSItemTitle
(
content
string
)
string
{
func
getRSSItemTitle
(
content
string
)
string
{
tokens
:=
tokenizer
.
Tokenize
(
content
)
nodes
,
_
:=
gomark
.
Parse
(
content
)
nodes
,
_
:=
parser
.
Parse
(
tokens
)
if
len
(
nodes
)
>
0
{
if
len
(
nodes
)
>
0
{
firstNode
:=
nodes
[
0
]
firstNode
:=
nodes
[
0
]
title
:=
renderer
.
NewStringRenderer
()
.
Render
([]
ast
.
Node
{
firstNode
})
title
:=
renderer
.
NewStringRenderer
()
.
Render
([]
ast
.
Node
{
firstNode
})
...
@@ -189,8 +160,7 @@ func getRSSItemTitle(content string) string {
...
@@ -189,8 +160,7 @@ func getRSSItemTitle(content string) string {
}
}
func
getRSSItemDescription
(
content
string
)
(
string
,
error
)
{
func
getRSSItemDescription
(
content
string
)
(
string
,
error
)
{
tokens
:=
tokenizer
.
Tokenize
(
content
)
nodes
,
err
:=
gomark
.
Parse
(
content
)
nodes
,
err
:=
parser
.
Parse
(
tokens
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
api/v1/v1.go
View file @
2b7bd47b
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/echo/v4/middleware"
"github.com/usememos/memos/api/resource"
"github.com/usememos/memos/api/resource"
"github.com/usememos/memos/api/rss"
"github.com/usememos/memos/plugin/telegram"
"github.com/usememos/memos/plugin/telegram"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store"
...
@@ -44,9 +45,6 @@ func NewAPIV1Service(secret string, profile *profile.Profile, store *store.Store
...
@@ -44,9 +45,6 @@ func NewAPIV1Service(secret string, profile *profile.Profile, store *store.Store
}
}
func
(
s
*
APIV1Service
)
Register
(
rootGroup
*
echo
.
Group
)
{
func
(
s
*
APIV1Service
)
Register
(
rootGroup
*
echo
.
Group
)
{
// Register RSS routes.
s
.
registerRSSRoutes
(
rootGroup
)
// Register API v1 routes.
// Register API v1 routes.
apiV1Group
:=
rootGroup
.
Group
(
"/api/v1"
)
apiV1Group
:=
rootGroup
.
Group
(
"/api/v1"
)
apiV1Group
.
Use
(
middleware
.
RateLimiterWithConfig
(
middleware
.
RateLimiterConfig
{
apiV1Group
.
Use
(
middleware
.
RateLimiterWithConfig
(
middleware
.
RateLimiterConfig
{
...
@@ -85,9 +83,12 @@ func (s *APIV1Service) Register(rootGroup *echo.Group) {
...
@@ -85,9 +83,12 @@ func (s *APIV1Service) Register(rootGroup *echo.Group) {
return
JWTMiddleware
(
s
,
next
,
s
.
Secret
)
return
JWTMiddleware
(
s
,
next
,
s
.
Secret
)
})
})
s
.
registerGetterPublicRoutes
(
publicGroup
)
s
.
registerGetterPublicRoutes
(
publicGroup
)
// Create and register resource public routes.
// Create and register resource public routes.
resourceService
:=
resource
.
NewService
(
s
.
Profile
,
s
.
Store
)
resource
.
NewResourceService
(
s
.
Profile
,
s
.
Store
)
.
RegisterRoutes
(
publicGroup
)
resourceService
.
RegisterResourcePublicRoutes
(
publicGroup
)
// Create and register rss public routes.
rss
.
NewRSSService
(
s
.
Profile
,
s
.
Store
)
.
RegisterRoutes
(
rootGroup
)
// programmatically set API version same as the server version
// programmatically set API version same as the server version
SwaggerInfo
.
Version
=
s
.
Profile
.
Version
SwaggerInfo
.
Version
=
s
.
Profile
.
Version
...
...
go.mod
View file @
2b7bd47b
...
@@ -25,7 +25,7 @@ require (
...
@@ -25,7 +25,7 @@ require (
github.com/spf13/viper v1.18.2
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.8.4
github.com/swaggo/swag v1.16.2
github.com/swaggo/swag v1.16.2
github.com/usememos/gomark v0.1.
0
github.com/usememos/gomark v0.1.
1
go.uber.org/zap v1.26.0
go.uber.org/zap v1.26.0
golang.org/x/crypto v0.18.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
...
...
go.sum
View file @
2b7bd47b
...
@@ -459,8 +459,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY
...
@@ -459,8 +459,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/usememos/gomark v0.1.
0 h1:3/hxfCm02iHptnHj1fYR38XXKGH8qVIDfYVa7/69tnc
=
github.com/usememos/gomark v0.1.
1 h1:e5AYuZCdPhcqI0gEG89zqw3r3sc/+O6nH2GvJpRI0/w
=
github.com/usememos/gomark v0.1.
0
/go.mod h1:7CZRoYFQyyljzplOTeyODFR26O+wr0BbnpTWVLGfKJA=
github.com/usememos/gomark v0.1.
1
/go.mod h1:7CZRoYFQyyljzplOTeyODFR26O+wr0BbnpTWVLGfKJA=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
...
...
web/src/pages/UserProfile.tsx
View file @
2b7bd47b
...
@@ -93,7 +93,7 @@ const UserProfile = () => {
...
@@ -93,7 +93,7 @@ const UserProfile = () => {
(
user
?
(
(
user
?
(
<>
<>
<
div
className=
"relative -mt-6 top-8 w-full flex justify-end items-center"
>
<
div
className=
"relative -mt-6 top-8 w-full flex justify-end items-center"
>
<
a
className=
""
href=
{
`/u/${
user?.id
}/rss.xml`
}
target=
"_blank"
rel=
"noopener noreferrer"
>
<
a
className=
""
href=
{
`/u/${
encodeURIComponent(user?.username)
}/rss.xml`
}
target=
"_blank"
rel=
"noopener noreferrer"
>
<
Button
color=
"neutral"
variant=
"outlined"
endDecorator=
{
<
Icon
.
Rss
className=
"w-4 h-auto opacity-60"
/>
}
>
<
Button
color=
"neutral"
variant=
"outlined"
endDecorator=
{
<
Icon
.
Rss
className=
"w-4 h-auto opacity-60"
/>
}
>
RSS
RSS
</
Button
>
</
Button
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment