diff --git a/server/frontend/frontend.go b/server/frontend/frontend.go
index 68620876..6734d208 100644
--- a/server/frontend/frontend.go
+++ b/server/frontend/frontend.go
@@ -80,9 +80,6 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) {
if memo == nil {
return c.HTML(http.StatusOK, rawIndexHTML)
}
- if memo.Visibility != store.Public {
- return c.HTML(http.StatusOK, rawIndexHTML)
- }
creator, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &memo.CreatorID,
})
@@ -97,15 +94,21 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) {
}
func generateMemoMetadata(memo *store.Memo, creator *store.User) string {
+ description := memo.Content
+ if memo.Visibility == store.Private {
+ description = "This memo is private."
+ } else if memo.Visibility == store.Protected {
+ description = "This memo is protected."
+ }
metadataList := []string{
- fmt.Sprintf(``, memo.Content),
+ fmt.Sprintf(``, description),
fmt.Sprintf(``, fmt.Sprintf("%s(@%s) on Memos", creator.Nickname, creator.Username)),
- fmt.Sprintf(``, memo.Content),
+ fmt.Sprintf(``, description),
fmt.Sprintf(``, "https://www.usememos.com/logo.png"),
``,
// Twitter related metadata.
fmt.Sprintf(``, fmt.Sprintf("%s(@%s) on Memos", creator.Nickname, creator.Username)),
- fmt.Sprintf(``, memo.Content),
+ fmt.Sprintf(``, description),
fmt.Sprintf(``, "https://www.usememos.com/logo.png"),
``,
}