opengraph attributes
parent
1d8a54b72f
commit
58ea651668
|
@ -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, "");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="en" prefix="og: https://ogp.me/ns#">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
@ -11,6 +11,9 @@
|
|||
<meta name="theme-color" content="#262626" media="(prefers-color-scheme: dark)">
|
||||
|
||||
<title>{{TITLE}}</title>
|
||||
<meta property="og:image" content="/.client/logo.png">
|
||||
<meta property="og:description" content={{DESCRIPTION}}>
|
||||
|
||||
<script>
|
||||
// Some global variables we need to make this work
|
||||
Deno = {
|
||||
|
|
Loading…
Reference in New Issue