diff --git a/website/_includes/_functions.jade b/website/_includes/_functions.jade index 0f435be54..d412fedff 100644 --- a/website/_includes/_functions.jade +++ b/website/_includes/_functions.jade @@ -22,3 +22,14 @@ - var branch = ALPHA ? 'develop' : branch - return 'https://github.com/' + SOCIAL.github + '/' + repo + (filepath ? '/blob/' + (branch || 'master') + '/' + filepath : '' ); - } + + +//- Get social images + +- function getSocialImg() { +- var base = SITE_URL + '/assets/img/social/preview_' +- var image = 'default' +- if (preview) image = preview +- else if (SECTION == 'docs') image = 'docs' +- return base + image + '.jpg' +- } diff --git a/website/_layout.jade b/website/_layout.jade index f0828fb33..482af35fa 100644 --- a/website/_layout.jade +++ b/website/_layout.jade @@ -24,13 +24,13 @@ html(lang="en") meta(property="og:url" content="#{SITE_URL}/#{current.path.join('/')}") meta(property="og:title" content="#{title} - spaCy") meta(property="og:description" content=description) - meta(property="og:image" content="#{SITE_URL}/assets/img/social#{(SECTION == 'docs') ? '_docs' : ''}.jpg") + meta(property="og:image" content=getSocialImg()) meta(name="twitter:card" content="summary_large_image") meta(name="twitter:site" content="@" + SOCIAL.twitter) meta(name="twitter:title" content="#{title} - spaCy") meta(name="twitter:description" content=description) - meta(name="twitter:image" content="#{SITE_URL}/assets/img/social#{(SECTION == 'docs') ? '_docs' : ''}.jpg") + meta(name="twitter:image" content=getSocialImg()) link(rel="shortcut icon" href="/assets/img/favicon.ico") link(rel="icon" type="image/x-icon" href="/assets/img/favicon.ico") diff --git a/website/assets/img/social/preview_101.jpg b/website/assets/img/social/preview_101.jpg new file mode 100644 index 000000000..448c63eaf Binary files /dev/null and b/website/assets/img/social/preview_101.jpg differ diff --git a/website/assets/img/social.jpg b/website/assets/img/social/preview_default.jpg similarity index 100% rename from website/assets/img/social.jpg rename to website/assets/img/social/preview_default.jpg diff --git a/website/assets/img/social_docs.jpg b/website/assets/img/social/preview_docs.jpg similarity index 100% rename from website/assets/img/social_docs.jpg rename to website/assets/img/social/preview_docs.jpg diff --git a/website/docs/usage/_data.json b/website/docs/usage/_data.json index 3d344eb2a..4d8dbb165 100644 --- a/website/docs/usage/_data.json +++ b/website/docs/usage/_data.json @@ -44,7 +44,8 @@ "spacy-101": { "title": "spaCy 101 – Everything you need to know", "next": "lightning-tour", - "quickstart": true + "quickstart": true, + "preview": "101" }, "lightning-tour": {