mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 09:57:29 -07:00
refactor: ♻️ ssr views
Correct og:type for users, format docs, deprecate _info_card_
This commit is contained in:
parent
5c305a85e6
commit
d33cee63bd
8 changed files with 12 additions and 79 deletions
|
@ -590,24 +590,6 @@ router.get("/channels/:channel", async (ctx, next) => {
|
|||
});
|
||||
//#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) => {
|
||||
await ctx.render("bios", {
|
||||
version: config.version,
|
||||
|
|
|
@ -13,7 +13,7 @@ block desc
|
|||
|
||||
block og
|
||||
unless privateMode
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= channel.description)
|
||||
meta(property='og:url' content= url)
|
||||
|
|
|
@ -14,7 +14,7 @@ block desc
|
|||
|
||||
block og
|
||||
unless privateMode
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= clip.description)
|
||||
meta(property='og:url' content= url)
|
||||
|
|
|
@ -14,7 +14,7 @@ block desc
|
|||
|
||||
block og
|
||||
unless privateMode
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= post.description)
|
||||
meta(property='og:url' content= url)
|
||||
|
|
|
@ -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
|
|
@ -18,7 +18,7 @@ block desc
|
|||
|
||||
block og
|
||||
unless privateMode
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= summary)
|
||||
meta(property='og:url' content= url)
|
||||
|
@ -27,7 +27,7 @@ block og
|
|||
meta(property='og:image:width' content=note.files[0].properties.width)
|
||||
meta(property='og:image:height' content=note.files[0].properties.height)
|
||||
meta(property='og:image:type' content=note.files[0].type)
|
||||
meta(property='twitter:card' content="summary_large_image")
|
||||
meta(property='twitter:card' content="summary_large_image")
|
||||
if isVideo
|
||||
meta(property='og:video:type' content=note.files[0].type)
|
||||
meta(property='og:video' content=note.files[0].url)
|
||||
|
|
|
@ -14,7 +14,7 @@ block desc
|
|||
|
||||
block og
|
||||
unless privateMode
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= page.summary)
|
||||
meta(property='og:url' content= url)
|
||||
|
|
|
@ -13,11 +13,12 @@ block desc
|
|||
|
||||
block og
|
||||
unless privateMode
|
||||
meta(property='og:type' content='blog')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= profile.description)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
meta(property='og:type' content='profile')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= profile.description)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
meta(property='profile:username' content= user.username)
|
||||
|
||||
block meta
|
||||
unless privateMode
|
||||
|
|
Loading…
Reference in a new issue