ph-bookshelf-wiki/configurations/shelf-frontend-custom.md

12 lines
893 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 使用自定义的 CSS/JS
目前ph-Bookshelf 提供了一个简单的在站点中使用你自己的 CSS 和 JS 文件自定义 ph-Bookshelf 的方式。
你可以在 `/data` 目录下建立 `custom.css` 文件和 `custom.js` 文件来自定义你的站点。
`custom.css` 中的内容会在预定义的 css 文件之后,作为 `<head>` 标签的最后一个子元素,内联进`<style>`输出。
`custom.js` 会在页面尾在预定义 js 输出后,通过内联进`<script>`输出。
对于 Book 或是 Page目前暂时还没有使用自定义 CSS 和 JS 的接口。尽管,你其实可以在 Markdown 文件里编写 `<style></style>``<script></script>` 标签。ph-Bookshelf 的 Markdown 的解析器并不会将这些标签*安全化*所以它们可以被正常使用。不过这也意味着你要注意自己在 Markdown 文本内的导入的内容的安全性。