add icon
parent
dc0d426b2c
commit
9f7a372fb9
|
@ -29,7 +29,8 @@
|
|||
"ga",
|
||||
"sitemap-general",
|
||||
"hide-element",
|
||||
"expandable-chapters-small"
|
||||
"expandable-chapters-small",
|
||||
"insert-logo"
|
||||
],
|
||||
"pluginsConfig": {
|
||||
"theme-default": {
|
||||
|
@ -75,6 +76,10 @@
|
|||
},
|
||||
"hide-element": {
|
||||
"elements": [".gitbook-link"]
|
||||
},
|
||||
"insert-logo": {
|
||||
"url": "https://jimmysong.io/images/logo-black-text.png",
|
||||
"style": "background: none; max-height: 100px; min-height: 30px"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <https://unlicense.org>
|
|
@ -0,0 +1,30 @@
|
|||
GitBook plugin: Insert logo
|
||||
===========================
|
||||
|
||||
NPM package [here](https://www.npmjs.com/package/gitbook-plugin-insert-logo)
|
||||
|
||||
```
|
||||
npm i gitbook-plugin-insert-logo
|
||||
```
|
||||
|
||||
The following plugin inserts a logo into the navigation bar (above the summary and above the search input). Simply, drop a `logo.png` file into the root folder of your GitBook and add this plugin into your `book.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["insert-logo", "another plugin 1", "another plugin 2"]
|
||||
}
|
||||
```
|
||||
|
||||
You will also need to provide url for the logo. The url can be local file, a remote URL, or base64 hash. Add the url into the plugin configuration in your `book.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["insert-logo", "another plugin 1", "another plugin 2"],
|
||||
"pluginsConfig": {
|
||||
"insert-logo": {
|
||||
"url": "http://www.example.com/my-logo.png"
|
||||
"style": "background: none;"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -0,0 +1,12 @@
|
|||
module.exports = {
|
||||
book: {
|
||||
assets: './lib',
|
||||
js: [
|
||||
'plugin.js'
|
||||
],
|
||||
css: [
|
||||
'plugin.css'
|
||||
]
|
||||
}
|
||||
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
.book .book-summary .book-logo {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
require(['gitbook', 'jQuery'], function (gitbook, $) {
|
||||
var url = ''
|
||||
var style = ''
|
||||
var insertLogo = function (url, style) {
|
||||
$('.book-summary').children().eq(0).before('<div class="book-logo"><img src="' + url + '" style="' + style + '"></div>')
|
||||
}
|
||||
gitbook.events.bind('start', function (e, config) {
|
||||
url = config['insert-logo']['url']
|
||||
style = config['insert-logo']['style']
|
||||
})
|
||||
|
||||
gitbook.events.bind("page.change", function() {
|
||||
insertLogo(url, style)
|
||||
})
|
||||
})
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"name": "gitbook-plugin-insert-logo",
|
||||
"raw": "gitbook-plugin-insert-logo@0.1.5",
|
||||
"rawSpec": "0.1.5",
|
||||
"scope": null,
|
||||
"spec": "0.1.5",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/jimmy/Workspace/github/rootsongjc/kubernetes-handbook"
|
||||
]
|
||||
],
|
||||
"_from": "gitbook-plugin-insert-logo@0.1.5",
|
||||
"_id": "gitbook-plugin-insert-logo@0.1.5",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/gitbook-plugin-insert-logo",
|
||||
"_nodeVersion": "6.11.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/gitbook-plugin-insert-logo_0.1.5_1521716276866_0.7489566873105806"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "matusnov@gmail.com",
|
||||
"name": "matusnov"
|
||||
},
|
||||
"_npmVersion": "3.5.2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "gitbook-plugin-insert-logo",
|
||||
"raw": "gitbook-plugin-insert-logo@0.1.5",
|
||||
"rawSpec": "0.1.5",
|
||||
"scope": null,
|
||||
"spec": "0.1.5",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gitbook-plugin-insert-logo/-/gitbook-plugin-insert-logo-0.1.5.tgz",
|
||||
"_shasum": "daae8dda41a236d54f13931e570b26729557885a",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "gitbook-plugin-insert-logo@0.1.5",
|
||||
"_where": "/Users/jimmy/Workspace/github/rootsongjc/kubernetes-handbook",
|
||||
"author": {
|
||||
"email": "matusnov@gmail.com",
|
||||
"name": "matusnovak"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/matusnovak/gitbook-plugin-insert-logo/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "GitBook Plugin to insert (url or file or base64) into the navigation above search input.",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"fileCount": 6,
|
||||
"shasum": "daae8dda41a236d54f13931e570b26729557885a",
|
||||
"tarball": "https://registry.npmjs.org/gitbook-plugin-insert-logo/-/gitbook-plugin-insert-logo-0.1.5.tgz",
|
||||
"unpackedSize": 3785
|
||||
},
|
||||
"engines": {
|
||||
"gitbook": ">1.x.x"
|
||||
},
|
||||
"gitHead": "fba26154a69508a0a84898423749f7dbea433485",
|
||||
"gitbook": {
|
||||
"properties": {
|
||||
"style": {
|
||||
"default": "background: none;",
|
||||
"title": "Custom CSS",
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"default": "http://www.example.com/my-logo.png",
|
||||
"title": "Logo URL",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"homepage": "https://github.com/matusnovak/gitbook-plugin-insert-logo#readme",
|
||||
"keywords": [
|
||||
"gitbook",
|
||||
"plugin",
|
||||
"insert-logo",
|
||||
"logo",
|
||||
"github"
|
||||
],
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "matusnov@gmail.com",
|
||||
"name": "matusnov"
|
||||
}
|
||||
],
|
||||
"name": "gitbook-plugin-insert-logo",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/matusnovak/gitbook-plugin-insert-logo.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "0.1.5"
|
||||
}
|
Loading…
Reference in New Issue