From f8521c2fe1469c549d5f363517d21117358f8862 Mon Sep 17 00:00:00 2001 From: Endilie Yacop Sucipto Date: Fri, 18 May 2018 12:26:06 +0800 Subject: [PATCH] Enhance footer with Facebook and Twitter buttons (#666) * enhance footer with social media buttons * Update api-site-config.md * Update Footer.js * fix minor issue on social-footer * update facebookAppId description in api-site-config * rm heading & pad footer social button * Update api-site-config.md --- docs/api-site-config.md | 5 +++- lib/core/Site.js | 2 +- lib/static/css/main.css | 4 +++ website/core/Footer.js | 65 ++++++++++++++++++++++++++--------------- website/siteConfig.js | 1 + 5 files changed, 52 insertions(+), 25 deletions(-) diff --git a/docs/api-site-config.md b/docs/api-site-config.md index 1371271ce942..e1fcefd83888 100644 --- a/docs/api-site-config.md +++ b/docs/api-site-config.md @@ -93,7 +93,7 @@ customDocsPath: 'website-docs' `editUrl` - url for editing docs, usage example: `editUrl + 'en/doc1.md'`. If this field is omitted, there will be no "Edit this Doc" button for each document. -`facebookAppId` - If you want Facebook Like/Share buttons at the bottom of your blog posts, provide a [Facebook application id](https://www.facebook.com/help/audiencenetwork/804209223039296), and the buttons will show up on all blog posts. +`facebookAppId` - If you want Facebook Like/Share buttons in the footer and at the bottom of your blog posts, provide a [Facebook application id](https://www.facebook.com/help/audiencenetwork/804209223039296). `facebookPixelId` - [Facebook Pixel](https://www.facebook.com/business/a/facebook-pixel) ID to track page views. @@ -154,6 +154,8 @@ h1 { `twitter` - Set this to `true` if you want a Twitter social button to appear at the bottom of your blog posts. +`twitterUsername` - If you want a Twitter follow button at the bottom of your page, provide a Twitter username to follow. For example: `docusaurus`. + `twitterImage` - Local path to your Twitter card image (e.g., `img/myImage.png`). This image will show up on the Twitter card when your site is shared on Twitter. `useEnglishUrl` - If you do not have [translations](guides-translation.md) enabled (e.g., by having a `languages.js` file), but still want a link of the form `/docs/en/doc.html` (with the `en`), set this to `true`. @@ -231,6 +233,7 @@ const siteConfig = { facebookAppId: '1615782811974223', facebookPixelId: '352490515235776', twitter: 'true', + twitterUsername: 'docusaurus', twitterImage: 'img/docusaurus.png', ogImage: 'img/docusaurus.png', }; diff --git a/lib/core/Site.js b/lib/core/Site.js index ab68638cf8e7..56cd611bbbb0 100644 --- a/lib/core/Site.js +++ b/lib/core/Site.js @@ -113,7 +113,7 @@ class Site extends React.Component { }} /> )} - {this.props.config.twitter && ( + {(this.props.config.twitter || this.props.config.twitterUsername) && (