refactor: ♻️ ssr views

Correct og:type for users, format docs, deprecate _info_card_
This commit is contained in:
ThatOneCalculator 2023-06-02 21:45:11 -07:00
parent 14126de3d7
commit 7ea4c39fb7
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
8 changed files with 12 additions and 79 deletions

View File

@ -590,24 +590,6 @@ router.get("/channels/:channel", async (ctx, next) => {
}); });
//#endregion //#endregion
router.get("/_info_card_", async (ctx) => {
const meta = await fetchMeta(true);
if (meta.privateMode) {
ctx.status = 403;
return;
}
ctx.remove("X-Frame-Options");
await ctx.render("info-card", {
version: config.version,
host: config.host,
meta: meta,
originalUsersCount: await Users.countBy({ host: IsNull() }),
originalNotesCount: await Notes.countBy({ userHost: IsNull() }),
});
});
router.get("/bios", async (ctx) => { router.get("/bios", async (ctx) => {
await ctx.render("bios", { await ctx.render("bios", {
version: config.version, version: config.version,

View File

@ -1,50 +0,0 @@
doctype html
html
head
meta(charset='utf-8')
meta(name='application-name' content='Calckey')
title= meta.name || host
style.
html, body {
margin: 0;
padding: 0;
min-height: 100vh;
background: #fff;
}
#a {
display: block;
}
#banner {
background-size: cover;
background-position: center center;
}
#title {
display: inline-block;
margin: 24px;
padding: 0.5em 0.8em;
color: #fff;
background: rgba(0, 0, 0, 0.5);
font-weight: bold;
font-size: 1.3em;
}
#content {
overflow: auto;
color: #353c3e;
}
#description {
margin: 24px;
}
body
a#a(href=`https://${host}` target="_blank")
header#banner(style=`background-image: url(${meta.bannerUrl})`)
div#title= meta.name || host
div#content
div#description= meta.description

View File

@ -13,11 +13,12 @@ block desc
block og block og
unless privateMode unless privateMode
meta(property='og:type' content='blog') meta(property='og:type' content='profile')
meta(property='og:title' content= title) meta(property='og:title' content= title)
meta(property='og:description' content= profile.description) meta(property='og:description' content= profile.description)
meta(property='og:url' content= url) meta(property='og:url' content= url)
meta(property='og:image' content= avatarUrl) meta(property='og:image' content= avatarUrl)
meta(property='profile:username' content= user.username)
block meta block meta
unless privateMode unless privateMode