add some more meta data

This commit is contained in:
Jonatan Nilsson 2019-10-01 17:36:28 +00:00
parent 5b0e9d1d2d
commit ecbf015cb6
3 changed files with 8 additions and 3 deletions

View file

@ -8,6 +8,7 @@ import Article from './article/model.mjs'
const body = readFileSync('./public/index.html').toString()
const bodyTemplate = dot.template(body)
const frontend = config.get('frontend:url')
function mapArticle(x) {
return {
@ -76,7 +77,8 @@ export async function serveIndex(ctx, path) {
let tree = null
let data = null
let links = null
let image = '/assets/img/heart.jpg'
let url = frontend + ctx.request.url
let image = frontend + '/assets/img/heart.jpg'
let title = 'NFP Moe - Anime/Manga translation group'
let description = 'Small fansubbing and scanlation group translating and encoding our favourite shows from Japan.'
try {
@ -139,6 +141,7 @@ export async function serveIndex(ctx, path) {
tree: JSON.stringify(tree),
data: JSON.stringify(data),
links: JSON.stringify(links),
url: url,
image: image,
title: title,
description: description,

View file

@ -27,7 +27,7 @@
]
},
"frontend": {
"url": "http://localhost:8080"
"url": "http://beta01.nfp.moe"
},
"jwt": {
"secret": "this-is-my-secret",

View file

@ -8,8 +8,10 @@
<meta name="twitter:card" value="summary">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:type" content="website" />
<meta id="ogimage" property="og:image" content="{{=it.image}}" />
<meta property="og:url" content="{{=it.url}}" />
<meta property="og:image" content="{{=it.image}}" />
<meta property="og:description" content="{{=it.description}}" />
<meta property="og:title" content="{{=it.title}}" />
{{? it.image === '/assets/img/heart.jpg' }}
<meta id="ogimagewidth" property="og:image:width" content="400" />
<meta id="ogimageheight" property="og:image:height" content="500" />