• 首页
  • 关于
  • 搜索
  • 夜间模式
    ©2021-2026  云岚博客 Theme by OneBlog

    云岚博客博客

    搜索
    标签
    # Linux # docker # 游戏 # Windows # Markdown # 日语 # html # h5ai # 计算机基础 # OpenWrt
  • 首页>
  • 默认分类>
  • 正文
  • h5ai界面美化

    2022年06月18日 346 阅读 0 评论 2376 字

    修改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.
    本文著作权归作者 [ 卧云揽月 ] 享有,未经作者书面授权,禁止转载,封面图片来源于 [ 互联网 ] ,本文仅供个人学习、研究和欣赏使用。如有异议,请联系博主及时处理。
    h5ai
    — END —
    首页关于
    Copyright©2021-2026  All Rights Reserved.  Load:0.008 s
    Theme by OneBlog V3.6.5
    夜间模式

    开源不易,请尊重作者版权,保留基本的版权信息。