mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Add fcbk open-graph and twitter-card metas for accounts, video-channels, playlists urls (#2996)
* Add open-graph and twitter-card metas to accounts and video-channels * Add open-graph and twitter-card to video-playlists watch view * Refactor meta-tags creation server-side * Add client.ts tests for account, channel and playlist tags * Correct lint forbidden spaces * Correct test regression on client.ts Co-authored-by: kimsible <kimsible@users.noreply.github.com>
This commit is contained in:
parent
7b3909644d
commit
8d987ec63e
4 changed files with 377 additions and 85 deletions
|
@ -17,6 +17,7 @@ const testEmbedPath = join(distPath, 'standalone', 'videos', 'test-embed.html')
|
|||
|
||||
// Special route that add OpenGraph and oEmbed tags
|
||||
// Do not use a template engine for a so little thing
|
||||
clientsRouter.use('/videos/watch/playlist/:id', asyncMiddleware(generateWatchPlaylistHtmlPage))
|
||||
clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage))
|
||||
clientsRouter.use('/accounts/:nameWithHost', asyncMiddleware(generateAccountHtmlPage))
|
||||
clientsRouter.use('/video-channels/:nameWithHost', asyncMiddleware(generateVideoChannelHtmlPage))
|
||||
|
@ -134,6 +135,12 @@ async function generateWatchHtmlPage (req: express.Request, res: express.Respons
|
|||
return sendHTML(html, res)
|
||||
}
|
||||
|
||||
async function generateWatchPlaylistHtmlPage (req: express.Request, res: express.Response) {
|
||||
const html = await ClientHtml.getWatchPlaylistHTMLPage(req.params.id + '', req, res)
|
||||
|
||||
return sendHTML(html, res)
|
||||
}
|
||||
|
||||
async function generateAccountHtmlPage (req: express.Request, res: express.Response) {
|
||||
const html = await ClientHtml.getAccountHTMLPage(req.params.nameWithHost, req, res)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue