diff options
author | Kim <1877318+kimsible@users.noreply.github.com> | 2020-07-31 11:29:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 11:29:15 +0200 |
commit | 8d987ec63e6888c839ad55938d45809869c517c6 (patch) | |
tree | d6a82b9254c1c473094ee9371688661f2ae6eef3 /server/controllers | |
parent | 7b3909644dd7cb8be1caad537bb40605e5f059d4 (diff) | |
download | PeerTube-8d987ec63e6888c839ad55938d45809869c517c6.tar.gz PeerTube-8d987ec63e6888c839ad55938d45809869c517c6.tar.zst PeerTube-8d987ec63e6888c839ad55938d45809869c517c6.zip |
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>
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/client.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 88f51907b..8c7f881a9 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -17,6 +17,7 @@ const testEmbedPath = join(distPath, 'standalone', 'videos', 'test-embed.html') | |||
17 | 17 | ||
18 | // Special route that add OpenGraph and oEmbed tags | 18 | // Special route that add OpenGraph and oEmbed tags |
19 | // Do not use a template engine for a so little thing | 19 | // Do not use a template engine for a so little thing |
20 | clientsRouter.use('/videos/watch/playlist/:id', asyncMiddleware(generateWatchPlaylistHtmlPage)) | ||
20 | clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage)) | 21 | clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage)) |
21 | clientsRouter.use('/accounts/:nameWithHost', asyncMiddleware(generateAccountHtmlPage)) | 22 | clientsRouter.use('/accounts/:nameWithHost', asyncMiddleware(generateAccountHtmlPage)) |
22 | clientsRouter.use('/video-channels/:nameWithHost', asyncMiddleware(generateVideoChannelHtmlPage)) | 23 | clientsRouter.use('/video-channels/:nameWithHost', asyncMiddleware(generateVideoChannelHtmlPage)) |
@@ -134,6 +135,12 @@ async function generateWatchHtmlPage (req: express.Request, res: express.Respons | |||
134 | return sendHTML(html, res) | 135 | return sendHTML(html, res) |
135 | } | 136 | } |
136 | 137 | ||
138 | async function generateWatchPlaylistHtmlPage (req: express.Request, res: express.Response) { | ||
139 | const html = await ClientHtml.getWatchPlaylistHTMLPage(req.params.id + '', req, res) | ||
140 | |||
141 | return sendHTML(html, res) | ||
142 | } | ||
143 | |||
137 | async function generateAccountHtmlPage (req: express.Request, res: express.Response) { | 144 | async function generateAccountHtmlPage (req: express.Request, res: express.Response) { |
138 | const html = await ClientHtml.getAccountHTMLPage(req.params.nameWithHost, req, res) | 145 | const html = await ClientHtml.getAccountHTMLPage(req.params.nameWithHost, req, res) |
139 | 146 | ||