修改h5ai网页默认显示域名和网页标题
1.修改默认显示域名
打开 _h5ai/public/js/scripts.js ,Ctrl+F 找到下面一行
"/"===t?p.getDomain():n.name
修改为
"/"===t?p'你想显示的内容':n.name
2.修改网页标题
修改_h5ai/private/php/pages/index.php 中的内容
<title>index - powered by h5ai v0.30 (https://larsjung.de/h5ai/)</title>
替换为
<title>你想显示的内容</title>
3.修改右上角信息:
打开 _h5ai/public/js/scripts.js ,Ctrl+F 找到下面一行
<a id="backlink" href="https://larsjung.de/h5ai/" title="powered by h5ai - https://larsjung.de/h5ai/">\n <div>powered</div>\n <div>by h5ai</div>\n </a>\n
4.页眉和页脚
在对应目录下放置好 _h5ai.header(s).html(页眉) 或 _h5ai.footer(s).html(页脚)即可,设置将应用于该目录或该目录的所有子目录。
同时h5ai支持Markdown格式页面,可以放置 _h5ai.header(s).md 和 _h5ai.footer(s).md 。
不同文件名称以及不同的存放位置会呈现不同的效果。
只在当前目录显示
- 页眉:_h5ai.header.html
- 页脚:_h5ai.footer.html
在当前及子目录显示
- 页眉:_h5ai.headers.html
- 页脚:_h5ai.footers.html
_h5ai.header(s).html 文件格式
<h1 style="text-align:center">标题</h1>
<p style="text-align:center">
正文内容
</p>
_h5ai.footer(s).html 文件格式
<p style="text-align:center">正文内容</p>
_h5ai.header(s).html 和 _h5ai.footer(s).html 的内容被添加在 <div></div> 里。所以页面里不能包含 <html><head><body> 等标签。
举例
页眉
_h5ai.headers.html
<h1 style="text-align:center">This is a header message</h1> <p style="text-align:center"> The header is read from file <code>_h5ai.header.html</code>. The content of this file will be enclosed by div tags. </p>
_h5ai.header.md
# This is a header message The header is read from file `_h5ai.header.html`.The content of this file will be enclosed by div tags.
页脚
_h5ai.footer.html
<p style="text-align:center"> The footer is read from file <code>_h5ai.footer.html</code>.The content of this file will be enclosed by div tags. </p> <p style="text-align:center"> <strong>Note</strong>: all files and directories of name <code>_h5ai*</code> are hidden from the index by default. </p>
_h5ai.footers.md
The footer is read from file `_h5ai.footer.html`. The content of this file will be enclosed by div tags. **Note**: all files and directories of name `_h5ai*` are hidden from the index by default.
评论