From 824b5b4c827101e81f18d52b06fc789437225ab1 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 25 Jun 2018 19:04:17 -0700 Subject: [PATCH] updated seo tags to match routes --- client/src/utils/metaTags.js | 6 +++--- .../pages/{sendEmbedPage.js => sendVideoEmbedPage.js} | 4 ++-- server/routes/pages/index.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename server/controllers/pages/{sendEmbedPage.js => sendVideoEmbedPage.js} (73%) diff --git a/client/src/utils/metaTags.js b/client/src/utils/metaTags.js index cd11b853..2210e5de 100644 --- a/client/src/utils/metaTags.js +++ b/client/src/utils/metaTags.js @@ -46,9 +46,9 @@ const createChannelMetaTags = ({siteHost, siteTitle, siteTwitter, channel}) => { const createAssetMetaTags = ({siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail}) => { const { claimData } = asset; const { contentType } = claimData; - const embedUrl = `${siteHost}/${claimData.claimId}/${claimData.name}`; + const videoEmbedUrl = `${siteHost}/video-embed/${claimData.name}/${claimData.claimId}`; const showUrl = `${siteHost}/${claimData.claimId}/${claimData.name}`; - const source = `${siteHost}/${claimData.claimId}/${claimData.name}.${claimData.fileExt}`; + const source = `${siteHost}/asset/${claimData.name}/${claimData.claimId}}`; const ogTitle = claimData.title || claimData.name; const ogDescription = claimData.description || defaultDescription; const ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail); @@ -70,7 +70,7 @@ const createAssetMetaTags = ({siteHost, siteTitle, siteTwitter, asset, defaultDe metaTags.push({property: 'og:image:type', content: ogThumbnailContentType}); metaTags.push({property: 'og:type', content: 'video'}); metaTags.push({property: 'twitter:card', content: 'player'}); - metaTags.push({property: 'twitter:player', content: embedUrl}); + metaTags.push({property: 'twitter:player', content: videoEmbedUrl}); metaTags.push({property: 'twitter:player:width', content: 600}); metaTags.push({property: 'twitter:text:player_width', content: 600}); metaTags.push({property: 'twitter:player:height', content: 337}); diff --git a/server/controllers/pages/sendEmbedPage.js b/server/controllers/pages/sendVideoEmbedPage.js similarity index 73% rename from server/controllers/pages/sendEmbedPage.js rename to server/controllers/pages/sendVideoEmbedPage.js index d4bef437..01f6b1f4 100644 --- a/server/controllers/pages/sendEmbedPage.js +++ b/server/controllers/pages/sendVideoEmbedPage.js @@ -1,10 +1,10 @@ const { details: { host } } = require('@config/siteConfig'); -const sendEmbedPage = ({ params }, res) => { +const sendVideoEmbedPage = ({ params }, res) => { const claimId = params.claimId; const name = params.name; // get and render the content res.status(200).render('embed', { layout: 'embed', host, claimId, name }); }; -module.exports = sendEmbedPage; +module.exports = sendVideoEmbedPage; diff --git a/server/routes/pages/index.js b/server/routes/pages/index.js index 225fa725..2dff606b 100644 --- a/server/routes/pages/index.js +++ b/server/routes/pages/index.js @@ -1,5 +1,5 @@ const handlePageRequest = require('../../controllers/pages/sendReactApp'); -// const handleEmbedRequest = require('../../controllers/pages/sendEmbedPage'); +const handleVideoEmbedRequest = require('../../controllers/pages/sendVideoEmbedPage'); const redirect = require('../../controllers/utils/redirect'); module.exports = (app) => { @@ -10,5 +10,5 @@ module.exports = (app) => { app.get('/popular', handlePageRequest); app.get('/new', handlePageRequest); app.get('/multisite', handlePageRequest); - // app.get('/embed/:claimId/:name', handleEmbedRequest); // route to send embedable video player (for twitter) + app.get('/video-embed/:name/:claimId', handleVideoEmbedRequest); // for twitter };