chore: update index.html

This commit is contained in:
Steven 2023-12-29 08:28:17 +08:00
parent 4cd01ece30
commit 0f8bfb6328
2 changed files with 4 additions and 2 deletions

View file

@ -79,7 +79,8 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) {
}
// Inject memo metadata into `index.html`.
indexHTML := strings.ReplaceAll(rawIndexHTML, "<!-- memos.metadata -->", generateMemoMetadata(memo, creator).String())
indexHTML := strings.ReplaceAll(rawIndexHTML, "<!-- memos.metadata.head -->", generateMemoMetadata(memo, creator).String())
indexHTML = strings.ReplaceAll(indexHTML, "<!-- memos.metadata.body -->", fmt.Sprintf("<!-- memos.memo.%d -->", memo.ID))
return c.HTML(http.StatusOK, indexHTML)
})
}

View file

@ -6,11 +6,12 @@
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f4f4f5" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#27272a" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<!-- memos.metadata -->
<!-- memos.metadata.head -->
<title>Memos</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<!-- memos.metadata.body -->
</body>
</html>