aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/client.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-21 14:06:10 +0100
committerChocobozzz <me@florianbigard.com>2019-02-21 14:06:10 +0100
commit92bf2f62995bbaa0402cb4657473ad8d5b6fcf8d (patch)
tree7f3f34b1503fd21db7f0b913c3b908f004015011 /server/controllers/client.ts
parent84c7cde6e81426a42e7aa29187b473bc89f1c8f6 (diff)
downloadPeerTube-92bf2f62995bbaa0402cb4657473ad8d5b6fcf8d.tar.gz
PeerTube-92bf2f62995bbaa0402cb4657473ad8d5b6fcf8d.tar.zst
PeerTube-92bf2f62995bbaa0402cb4657473ad8d5b6fcf8d.zip
Improve channel and account SEO
Diffstat (limited to 'server/controllers/client.ts')
-rw-r--r--server/controllers/client.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index f17f2a5d2..ece2f460c 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -17,6 +17,8 @@ const testEmbedPath = join(distPath, 'standalone', 'videos', 'test-embed.html')
17// Special route that add OpenGraph and oEmbed tags 17// Special route that add OpenGraph and oEmbed tags
18// Do not use a template engine for a so little thing 18// Do not use a template engine for a so little thing
19clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage)) 19clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage))
20clientsRouter.use('/accounts/:nameWithHost', asyncMiddleware(generateAccountHtmlPage))
21clientsRouter.use('/video-channels/:nameWithHost', asyncMiddleware(generateVideoChannelHtmlPage))
20 22
21clientsRouter.use( 23clientsRouter.use(
22 '/videos/embed', 24 '/videos/embed',
@@ -99,6 +101,18 @@ async function generateWatchHtmlPage (req: express.Request, res: express.Respons
99 return sendHTML(html, res) 101 return sendHTML(html, res)
100} 102}
101 103
104async function generateAccountHtmlPage (req: express.Request, res: express.Response) {
105 const html = await ClientHtml.getAccountHTMLPage(req.params.nameWithHost, req, res)
106
107 return sendHTML(html, res)
108}
109
110async function generateVideoChannelHtmlPage (req: express.Request, res: express.Response) {
111 const html = await ClientHtml.getVideoChannelHTMLPage(req.params.nameWithHost, req, res)
112
113 return sendHTML(html, res)
114}
115
102function sendHTML (html: string, res: express.Response) { 116function sendHTML (html: string, res: express.Response) {
103 res.set('Content-Type', 'text/html; charset=UTF-8') 117 res.set('Content-Type', 'text/html; charset=UTF-8')
104 118