Remove sourceCodeButton config key (#181)

This commit is contained in:
Héctor Ramos 2017-10-26 12:16:36 -07:00 committed by GitHub
parent db8daa635d
commit ba666cc6ae
6 changed files with 10 additions and 18 deletions

View file

@ -80,8 +80,6 @@ headerLinks: [
`gaTrackingId` - Google Analytics tracking ID to track page views. `gaTrackingId` - Google Analytics tracking ID to track page views.
`sourceCodeButton` - the type of button to use for pointing to your source code. If this field is non-null, the site will pull in the appropriate button code in the header, for you to be able to render as you see fit. Currently accepted values: `"github"`, `"none"`. Defaults to `"github"`.
`highlight` - [Syntax highlighting](api-doc-markdown.md) options: `highlight` - [Syntax highlighting](api-doc-markdown.md) options:
- `theme` is the name of the theme used by Highlight.js when highlighting code. - `theme` is the name of the theme used by Highlight.js when highlighting code.
@ -142,7 +140,6 @@ const siteConfig = {
indexName: "github" indexName: "github"
}, },
gaTrackingId: "U-A2352", gaTrackingId: "U-A2352",
sourceCodeButton: "github",
highlight: { highlight: {
theme: 'default' theme: 'default'
}, },

View file

@ -10,10 +10,10 @@ const React = require("react");
const githubButton = ( const githubButton = (
<a <a
className="github-button" className="github-button"
href="https://github.com/deltice/test-site" href={this.props.config.repoUrl}
data-icon="octicon-star" data-icon="octicon-star"
data-count-href="/deltice/test-site/stargazers" data-count-href="/deltice/test-site/stargazers"
data-count-api="/repos/deltice/test-site#stargazers_count" data-show-count={true}
data-count-aria-label="# stargazers on GitHub" data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub" aria-label="Star this project on GitHub"
> >

View file

@ -18,7 +18,7 @@ const users = [
const siteConfig = { const siteConfig = {
title: "Test Site" /* title for your website */, title: "Test Site" /* title for your website */,
tagline: "A website for testing", tagline: "A website for testing",
url: "https://deltice.github.io" /* your github url */, url: "https://deltice.github.io" /* your website url */,
baseUrl: "/test-site/" /* base url for your project */, baseUrl: "/test-site/" /* base url for your project */,
projectName: "test-site", projectName: "test-site",
headerLinks: [ headerLinks: [
@ -45,7 +45,12 @@ const siteConfig = {
highlight: { highlight: {
// Highlight.js theme to use for syntax highlighting in code blocks // Highlight.js theme to use for syntax highlighting in code blocks
theme: "default" theme: "default"
} },
scripts: [
"https://buttons.github.io/buttons.js"
],
// You may provide arbitrary config keys to be used as needed by your template.
repoUrl: "https://github.com/deltice/test-site",
}; };
module.exports = siteConfig; module.exports = siteConfig;

View file

@ -15,10 +15,6 @@ class Head extends React.Component {
links.map(link => { links.map(link => {
if (link.blog) hasBlog = true; if (link.blog) hasBlog = true;
}); });
const sourceCodeButton = this.props.config.sourceCodeButton;
// defaults to GitHub, but other values may be allowed in the future
const includeGitHubButton =
sourceCodeButton === "github" || sourceCodeButton == null;
const highlightDefaultVersion = '9.12.0'; const highlightDefaultVersion = '9.12.0';
const highlightConfig = this.props.config.highlight const highlightConfig = this.props.config.highlight
@ -82,9 +78,6 @@ class Head extends React.Component {
title={this.props.config.title + " Blog RSS Feed"} title={this.props.config.title + " Blog RSS Feed"}
/> />
)} )}
{includeGitHubButton && (
<script async defer src="https://buttons.github.io/buttons.js" />
)}
<link <link
rel="stylesheet" rel="stylesheet"
href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${highlightVersion}/styles/${highlightTheme}.min.css`} href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${highlightVersion}/styles/${highlightTheme}.min.css`}

View file

@ -48,9 +48,7 @@ class Footer extends React.Component {
className="github-button" className="github-button"
href="https://github.com/facebookexperimental/docusaurus" href="https://github.com/facebookexperimental/docusaurus"
data-icon="octicon-star" data-icon="octicon-star"
data-count-href="/facebookexperimental/docusaurus/stargazers" data-show-count="true"
data-count-api="/repos/facebookexperimental/docusaurus#stargazers_count"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub" aria-label="Star this project on GitHub"
> >
Star Star

View file

@ -56,7 +56,6 @@ const siteConfig = {
headerIcon: "img/docusaurus.svg", headerIcon: "img/docusaurus.svg",
footerIcon: "img/docusaurus_monochrome.svg", footerIcon: "img/docusaurus_monochrome.svg",
favicon: "img/docusaurus.ico", favicon: "img/docusaurus.ico",
// See https://docusaurus.io/docs/search for more information about Aloglia
algolia: { algolia: {
apiKey: "3eb9507824b8be89e7a199ecaa1a9d2c", apiKey: "3eb9507824b8be89e7a199ecaa1a9d2c",
indexName: "docusaurus" indexName: "docusaurus"