diff --git a/server/http_server.ts b/server/http_server.ts index b2e5be7e..2d6742c4 100644 --- a/server/http_server.ts +++ b/server/http_server.ts @@ -132,6 +132,10 @@ export class HttpServer { "{{SPACE_PATH}}", spaceServer.pagesPath.replaceAll("\\", "\\\\"), ) + .replace( + "{{DESCRIPTION}}", + JSON.stringify(stripHtml(html).substring(0, 255)), + ) .replace( "{{TITLE}}", pageName, @@ -663,3 +667,8 @@ function utcDateString(mtime: number): string { function authCookieName(host: string) { return `auth_${host.replaceAll(/\W/g, "_")}`; } + +function stripHtml(html: string): string { + const regex = /<[^>]*>/g; + return html.replace(regex, ""); +} diff --git a/web/index.html b/web/index.html index 7a866e3d..d02d247c 100644 --- a/web/index.html +++ b/web/index.html @@ -1,5 +1,5 @@ - + @@ -11,6 +11,9 @@ {{TITLE}} + + +