mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-02 18:55:53 +00:00
Merge pull request #681 from sharelatex/jel-cms-meta-and-btn
CMS: control of metadata
This commit is contained in:
commit
9f5e976539
3 changed files with 65 additions and 53 deletions
services/web
60
services/web/app/views/_metadata.pug
Normal file
60
services/web/app/views/_metadata.pug
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
//- Title
|
||||
-if (metadata && metadata.title)
|
||||
title= metadata.title + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
|
||||
meta(name="twitter:title", content=metadata.title)
|
||||
meta(name="og:title", content=metadata.title)
|
||||
-else if (typeof(title) == "undefined")
|
||||
title= settings.appName + ', '+ translate("online_latex_editor")
|
||||
meta(name="twitter:title", content=settings.appName + ', '+ translate("online_latex_editor"))
|
||||
meta(name="og:title", content=settings.appName + ', '+ translate("online_latex_editor"))
|
||||
-else
|
||||
title= translate(title) + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
|
||||
//- to do - not translate?
|
||||
meta(name="twitter:title", content=translate(title))
|
||||
meta(name="og:title", content=translate(title))
|
||||
|
||||
//- Description
|
||||
-if (metadata && metadata.description)
|
||||
meta(itemprop="description", name="description" , content=metadata.description)
|
||||
//-twitter and og descriptions handeled below
|
||||
-else
|
||||
meta(itemprop="description", name="description", content=translate("site_description"))
|
||||
meta(itemprop="description", name="twitter:description", content=translate("site_description"))
|
||||
meta(itemprop="description", name="og:description", content=translate("site_description"))
|
||||
|
||||
//- Image
|
||||
-if (metadata && metadata.image)
|
||||
meta(itemprop="image", name="image", content=metadata.image.fields.file.url)
|
||||
-else
|
||||
meta(itemprop="image", name="image", content="/" + settings.brandPrefix + "favicon.ico")
|
||||
|
||||
//- Keywords
|
||||
-if (metadata && metadata.keywords)
|
||||
meta(name="keywords" content=metadata.keywords)
|
||||
|
||||
//- Misc
|
||||
meta(itemprop="name", content=settings.appName + ", the Online LaTeX Editor")
|
||||
|
||||
//- Twitter
|
||||
meta(name="twitter:card", content=metadata.twitterCardType ? metadata.twitterCardType : 'summary')
|
||||
-if (settings.social && settings.social.twitter && settings.social.twitter.handle)
|
||||
meta(name="twitter:site", content="@" + settings.social.twitter.handle)
|
||||
-if (metadata && metadata.twitterDescription)
|
||||
meta(itemprop="twitter:description", content=metadata.twitterDescription)
|
||||
-if (metadata && metadata.twitterImage)
|
||||
meta(itemprop="image", name="twitter:image", content=metadata.twitterImage.fields.file.url)
|
||||
meta(itemprop="image", name="twitter:image:alt", content=metadata.twitterImage.fields.title)
|
||||
|
||||
//- Open Graph
|
||||
//- to do - add og:url
|
||||
-if (settings.social && settings.social.facebook && settings.social.facebook.appId)
|
||||
meta(name="fb:app_id", content=settings.social.facebook.appId)
|
||||
-if (metadata && metadata.openGraphDescription)
|
||||
meta(itemprop="description", name="og:description", content=metadata.openGraphDescription)
|
||||
-if (metadata && metadata.openGraphImage)
|
||||
meta(itemprop="image", name="og:image", content=metadata.openGraphImage.fields.file.url)
|
||||
-if (metadata && metadata.openGraphType)
|
||||
meta(name="og:type", metadata.openGraphType)
|
||||
-else
|
||||
meta(name="og:type", content="website")
|
|
@ -1,28 +1,19 @@
|
|||
doctype html
|
||||
html(itemscope, itemtype='http://schema.org/Product')
|
||||
- metadata = metadata || {}
|
||||
block vars
|
||||
|
||||
head
|
||||
include ./_metadata.pug
|
||||
|
||||
script(type="text/javascript").
|
||||
// Stop superfish from loading
|
||||
window.similarproducts = true
|
||||
style [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {display: none !important; display: none; }
|
||||
|
||||
|
||||
-if (typeof(gaExperiments) != "undefined")
|
||||
|!{gaExperiments}
|
||||
|
||||
//- Title
|
||||
-if (typeof(title) == "undefined")
|
||||
title= settings.appName + ', '+ translate("online_latex_editor")
|
||||
meta(name="twitter:title", content=settings.appName + ', '+ translate("online_latex_editor"))
|
||||
meta(name="og:title", content=settings.appName + ', '+ translate("online_latex_editor"))
|
||||
-else
|
||||
title= translate(title) + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
|
||||
//- to do - not translate?
|
||||
meta(name="twitter:title", content=translate(title))
|
||||
meta(name="og:title", content=translate(title))
|
||||
|
||||
//- Icons
|
||||
link(rel="icon", href="/" + settings.brandPrefix + "favicon.ico")
|
||||
link(rel="icon", sizes="192x192", href="/" + settings.brandPrefix + "touch-icon-192x192.png")
|
||||
|
@ -39,45 +30,6 @@ html(itemscope, itemtype='http://schema.org/Product')
|
|||
if !subdomainDetails.hide
|
||||
link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
|
||||
|
||||
|
||||
meta(itemprop="name", content=settings.appName + ", the Online LaTeX Editor")
|
||||
|
||||
//- Description
|
||||
-if (typeof(meta) == "undefined")
|
||||
meta(itemprop="description", name="description", content=translate("site_description"))
|
||||
-else
|
||||
meta(itemprop="description", name="description" , content=meta)
|
||||
|
||||
-if (typeof(metaImage) == "undefined")
|
||||
meta(itemprop="image", name="image", content="/" + settings.brandPrefix + "favicon.ico")
|
||||
-else
|
||||
meta(itemprop="image", name="image", content=metaImage.fields.file.url)
|
||||
|
||||
//- Meta Tags: Twitter
|
||||
-if (settings.social && settings.social.twitter && settings.social.twitter.handle)
|
||||
meta(name="twitter:site", content=settings.social.twitter.handle)
|
||||
meta(name="twitter:card", content=metaTwitterCard ? metaTwitterCard : 'summary')
|
||||
-if (typeof(metaTwitterDescription) != "undefined")
|
||||
meta(itemprop="twitter:description", content=metaTwitterDescription)
|
||||
-if (typeof(metaTwitterImage) != "undefined")
|
||||
meta(itemprop="image", name="image", content=metaTwitterImage.fields.file.url)
|
||||
-else if (typeof(metaImage) != "undefined")
|
||||
meta(itemprop="image", name="image", content=metaImage.fields.file.url)
|
||||
|
||||
//- Meta Tags: Open Graph
|
||||
-if (settings.social && settings.social.facebook && settings.social.facebook.appId)
|
||||
meta(name="fb:app_id", content=settings.social.facebook.appId)
|
||||
-if (typeof(metaOpenGraphDescription) != "undefined")
|
||||
meta(itemprop="og:description", content=metaOpenGraphDescription)
|
||||
-if (typeof(metaOpenGraphImage) != "undefined")
|
||||
meta(itemprop="image", name="image", content=metaOpenGraphImage.fields.file.url)
|
||||
-else if (typeof(metaImage) != "undefined")
|
||||
meta(itemprop="image", name="image", content=metaImage.fields.file.url)
|
||||
-if (typeof(metaOgType) != "undefined")
|
||||
meta(name="og:type", metaOgType)
|
||||
-else
|
||||
meta(name="og:type", content="website")
|
||||
|
||||
//- Scripts
|
||||
|
||||
//- Google Analytics
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
including About and Blog
|
||||
*/
|
||||
.cms-page {
|
||||
.contact-btn-description {
|
||||
.btn-description {
|
||||
margin-right: @margin-sm;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
.cms-preview {
|
||||
background-color: @blue;
|
||||
color: black;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
height: @navbar-padding-vertical;
|
||||
left: 0;
|
||||
|
|
Loading…
Reference in a new issue