diff options
author | Samy Pessé <samypesse@gmail.com> | 2017-01-06 17:15:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-06 17:15:30 +0100 |
commit | 7029c01806781f5ed74f175545ea154aa17cc6fd (patch) | |
tree | d87189690b5acc78acbd3d9688edc37b251541f3 /packages/gitbook-plugin-theme-default/src | |
parent | 11893255d1167382b16871d2ca831c90a40af57d (diff) | |
download | gitbook-7029c01806781f5ed74f175545ea154aa17cc6fd.zip gitbook-7029c01806781f5ed74f175545ea154aa17cc6fd.tar.gz gitbook-7029c01806781f5ed74f175545ea154aa17cc6fd.tar.bz2 |
Switch to markup-it for parsing (#1659)
* Start new parsers in gitbook itself
* Update markup-it
* Fix eslint errors
* Adapt basic parsing for summary
* Start tests for summaryFromDocument
* Continue
* Add parsing of glossary
* Add back languages parsing
* Adapt most tests for parsing
* Adapt all tests 🙌
* Adapt travis tests
* Bootstrap lerna before running tests
* Fix lowercase in require (linux)
* Fix command gitbook init
* Fix generation of ready by init command
* Fix generation of summary
* Fix watch after serve
* Add trademark to sidebar
* Add back favicon to default theme
* Open trademark in new tab
Diffstat (limited to 'packages/gitbook-plugin-theme-default/src')
-rw-r--r-- | packages/gitbook-plugin-theme-default/src/components/Sidebar.js | 21 | ||||
-rw-r--r-- | packages/gitbook-plugin-theme-default/src/components/Theme.js | 13 |
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 }; }); |