summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-theme-default/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-plugin-theme-default/src/components')
-rw-r--r--packages/gitbook-plugin-theme-default/src/components/Sidebar.js21
-rw-r--r--packages/gitbook-plugin-theme-default/src/components/Theme.js13
2 files changed, 30 insertions, 4 deletions
diff --git a/packages/gitbook-plugin-theme-default/src/components/Sidebar.js b/packages/gitbook-plugin-theme-default/src/components/Sidebar.js
index ab628df..fd10730 100644
--- a/packages/gitbook-plugin-theme-default/src/components/Sidebar.js
+++ b/packages/gitbook-plugin-theme-default/src/components/Sidebar.js
@@ -3,6 +3,25 @@ const { React } = GitBook;
const Summary = require('./Summary');
+/**
+ * The GitBook trademark.
+ * @type {ReactClass}
+ */
+const GitBookTrademark = React.createClass({
+ render() {
+ return (
+ <a className="GitBookTrademark" href="https://www.gitbook.com/?utm_source=gitbook&utm_medium=trademark" target="_blank">
+ <span>Published with <b>GitBook</b></span>
+ <GitBook.Image src="gitbook/theme-default/images/logo.svg" />
+ </a>
+ );
+ }
+});
+
+/**
+ * Sidebar containing a serch bar, the table of contents, and the GitBook trademark.
+ * @type {ReactClass}
+ */
const Sidebar = React.createClass({
propTypes: {
summary: GitBook.PropTypes.Summary
@@ -16,6 +35,8 @@ const Sidebar = React.createClass({
<div className="Sidebar book-summary">
<GitBook.InjectedComponent matching={{ role: 'search:container:input' }} />
<Summary summary={summary} />
+
+ <GitBookTrademark />
</div>
</div>
);
diff --git a/packages/gitbook-plugin-theme-default/src/components/Theme.js b/packages/gitbook-plugin-theme-default/src/components/Theme.js
index b323fc4..884c862 100644
--- a/packages/gitbook-plugin-theme-default/src/components/Theme.js
+++ b/packages/gitbook-plugin-theme-default/src/components/Theme.js
@@ -8,6 +8,7 @@ const LoadingBar = require('./LoadingBar');
const Theme = React.createClass({
propTypes: {
// State
+ file: GitBook.PropTypes.File,
page: GitBook.PropTypes.Page,
summary: GitBook.PropTypes.Summary,
readme: GitBook.PropTypes.Readme,
@@ -18,14 +19,18 @@ const Theme = React.createClass({
},
render() {
- const { page, summary, children, sidebar, readme, history } = this.props;
+ const { file, page, summary, children, sidebar, readme, history } = this.props;
return (
<GitBook.FlexLayout column className="GitBook book">
<LoadingBar show={history.loading} />
<GitBook.Head
title={page.title}
- titleTemplate="%s - GitBook" />
+ titleTemplate="%s - GitBook"
+ link={[
+ {rel: 'shortcut icon', href: file.relative('gitbook/theme-default/images/favicon.ico')}
+ ]}
+ />
<GitBook.ImportCSS href="gitbook/theme-default/theme.css" />
<GitBook.FlexBox>
@@ -52,6 +57,6 @@ const Theme = React.createClass({
}
});
-module.exports = GitBook.connect(Theme, ({page, summary, sidebar, readme, history}) => {
- return { page, summary, sidebar, readme, history };
+module.exports = GitBook.connect(Theme, ({file, page, summary, sidebar, readme, history}) => {
+ return { file, page, summary, sidebar, readme, history };
});