mirror of
https://github.com/usememos/memos.git
synced 2025-03-03 16:53:30 +08:00
chore: remove user urlsets in sitemap
This commit is contained in:
parent
8e325f9986
commit
fcfb76a103
1 changed files with 0 additions and 9 deletions
|
@ -118,15 +118,6 @@ Sitemap: %s/sitemap.xml`, instanceURL, instanceURL)
|
|||
for _, memo := range memoList {
|
||||
urlsets = append(urlsets, fmt.Sprintf(`<url><loc>%s</loc></url>`, fmt.Sprintf("%s/m/%d", instanceURL, memo.ID)))
|
||||
}
|
||||
// Append user list.
|
||||
userList, err := s.Store.ListUsers(ctx, &store.FindUser{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, user := range userList {
|
||||
urlsets = append(urlsets, fmt.Sprintf(`<url><loc>%s</loc></url>`, fmt.Sprintf("%s/u/%s", instanceURL, user.Username)))
|
||||
}
|
||||
|
||||
sitemap := fmt.Sprintf(`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">%s</urlset>`, strings.Join(urlsets, "\n"))
|
||||
return c.XMLBlob(http.StatusOK, []byte(sitemap))
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue