{"id":19821642,"url":"https://github.com/lanfly/gitbook-plugin-logo","last_synced_at":"2025-06-22T06:04:53.605Z","repository":{"id":83199708,"uuid":"181536264","full_name":"LanFly/gitbook-plugin-logo","owner":"LanFly","description":"GitBook Plugin to add your logo and title easily and Beautifully. Support for inserting custom DOM and Style.","archived":false,"fork":false,"pushed_at":"2019-04-16T12:36:28.000Z","size":5,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T22:42:49.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LanFly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-15T17:38:27.000Z","updated_at":"2023-01-30T06:57:07.000Z","dependencies_parsed_at":"2023-03-13T20:07:01.506Z","dependency_job_id":null,"html_url":"https://github.com/LanFly/gitbook-plugin-logo","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"1b348392a8942313e13886a52f62d516402e2c13"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LanFly/gitbook-plugin-logo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Fgitbook-plugin-logo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Fgitbook-plugin-logo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Fgitbook-plugin-logo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Fgitbook-plugin-logo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LanFly","download_url":"https://codeload.github.com/LanFly/gitbook-plugin-logo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Fgitbook-plugin-logo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261244016,"owners_count":23129640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:29:47.636Z","updated_at":"2025-06-22T06:04:48.579Z","avatar_url":"https://github.com/LanFly.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitbook-plugin-logo\n\n![NPM](https://img.shields.io/npm/l/gitbook-plugin-logo.svg)\n![npm](https://img.shields.io/npm/v/gitbook-plugin-logo.svg)\n\nGitBook Plugin to add your logo and title easily and Beautifully. Support for inserting custom DOM and Style.\n\n一个在 `Gitbook` 网站中添加你的 `logo` 或 `标识` 的插件，使用简单，自带美观的样式，支持自定义 DOM 和 CSS 样式。\n\n# 特性\n\n- 使用简单\n- 自带默认样式\n- 支持自定义行内样式\n- 支持自定义 DOM 和 CSS\n\n# 安装\n\n```shell\nnpm install gitbook-plugin-logo --save\n```\n\n# 简单使用\n\n在 `book.json` 文件中增加配置：\n\n```json\n{\n  \"plugins\": [\n    \"logo\"\n  ],\n  \"pluginsConfig\": {\n    \"logo\": {\n      \"logo\": \"http://lanfly.vicp.io/logo.png\",\n      \"title\": \"提莫的神秘商店\",\n      \"url\": \"http://timor.tech\"\n    }\n  }\n}\n```\n\n上面的配置会默认添加 `rootStyle` 样式：\n\n```css\ntext-align: center;\npadding: 20px;\n```\n\n# 自定义行内样式\n\n你可以添加自定义的样式，它们会以 `行内样式` 添加到 `DOM` 元素上。\n\n```json\n{\n  \"plugins\": [\n    \"logo\"\n  ],\n  \"pluginsConfig\": {\n    \"logo\": {\n      \"rootStyle\": \"background-color: #a5b807; text-align: center; padding: 20px;\",\n      \"logo\": \"http://lanfly.vicp.io/logo.png\",\n      \"logoStyle\": \"width: 70px;\",\n      \"title\": \"提莫的神秘商店\",\n      \"titleStyle\": \"color: #FFF; text-align: center;\",\n      \"url\": \"http://timor.tech\"\n    }\n  }\n}\n```\n\n`rootStyle` 是最外层 DOM 的样式，上面的配置会生成下面的 DOM 结构：\n\n```html\n\u003ca href=\"$url\" class=\"book-logo-root\"\u003e\n  \u003cdiv class=\"book-logo\" style=\"$rootStyle\"\u003e\n    \u003cimg src=\"$logo\" style=\"$logoStyle\" /\u003e\n    \u003cp class=\"book-title\" style=\"$titleStyle\"\u003e$title\u003c/p\u003e\n  \u003c/div\u003e\n\u003c/a\u003e\n```\n\n# 自定义 DOM 和 CSS\n\n如果你想让你网站的 logo 变得更酷炫，你可以自定义 DOM 和 CSS 来达到效果。\n\n```json\n{\n  \"plugins\": [\n    \"logo\"\n  ],\n  \"pluginsConfig\": {\n    \"logo\": {\n      \"style\": \"logo/style.css\",\n      \"template\": \"logo/template.html\"\n    }\n  }\n}\n```\n\n插件会从你指定的文件中读取内容，然后将它们插入到每个页面中。\n\n`template` 文件内容会插入到 `body .book-summary` 元素里面，作为第一个子元素。\n\n`style` 文件内容会使用 `\u003cstyle type=\"text/css\"\u003e\u003c/style\u003e` 包装然后追加到 `head`。\n\n# BUG 报告\n\n[https://github.com/LanFly/gitbook-plugin-logo/issues](https://github.com/LanFly/gitbook-plugin-logo/issues)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanfly%2Fgitbook-plugin-logo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanfly%2Fgitbook-plugin-logo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanfly%2Fgitbook-plugin-logo/lists"}