V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
closers
V2EX  ›  问与答

h5ai 怎么自定义顶部和底部?

  •  
  •   closers · Feb 26, 2017 · 3514 views
    This topic created in 3357 days ago, the information mentioned may be changed or developed.

    /* Allow customized header and footer files. First checks for files "_h5ai.header.html" and "_h5ai.footer.html" in the current directory. If not successful it checks all parent directories (starting in the current directory) for files "_h5ai.headers.html" and "_h5ai.footers.html". Note the different filenames: "header" (only current) - "headers" (current and sub directories)! The file's content will be placed inside a

    tag above/below the main content. If a file's extension is ".md" instead of ".html" its content will be interpreted as markdown. */ "custom": { "enabled": true },

    h5ai 是一个目录列表程序(网站),我按照上面的配置文件的指示分别在根目录创建了_h5ai.header.html 和_h5ai.footer.html ,但是首页没有啊,是不是还需要配置什么?有木有大大用过?

    9 replies    2017-02-28 07:08:16 +08:00
    zrj766
        1
    zrj766  
       Feb 26, 2017
    底部没弄过,顶部可以试试 /_h5ai/private/php/pages/index.php
    closers
        2
    closers  
    OP
       Feb 26, 2017
    @zrj766 我试过了,只在加载的时候显示,加载完后就没有了
    Vicer
        3
    Vicer  
       Feb 27, 2017 via Android
    心疼你,这么久了,还没有正确答案,开始看到了,以为有人知道,就没回复。
    最新版的在配置文件里有选项,配置一下就好,曾经这个问题也是烦了我几天,最后还是自己找出来的。
    Vicer
        4
    Vicer  
       Feb 27, 2017 via Android
    看错了,回复错了,我还以为是标题,忽视上面的回复
    SharkIng
        5
    SharkIng  
       Feb 27, 2017 via iPhone
    有个 header 和 footer 的文件的
    closers
        6
    closers  
    OP
       Feb 27, 2017
    @SharkIng h5ai-0.29.0 这最新版的没有啊,还是我姿势有问题?
    closers
        7
    closers  
    OP
       Feb 27, 2017
    @Vicer 惊现大佬啊( loc
    SharkIng
        8
    SharkIng  
       Feb 28, 2017
    @closers
    我也用的是 0.29.0 啊

    首先根据他的文档,你的目录形式应该是 ROOT/_h5ai. 也就是说把它的_h5ai 的文件夹放在根目录下
    然后根目录下( ROOT/)放你的各种文件 /文件夹。
    这里你需要把_h5ai.headers.html 和 _h5ai.footers.html (或者.md 结尾也行) 放在根目录,也就是和 ROOT 一起,如果你在 ROOT 里面用 `ls` 应该看到的是类似这样的
    ```
    _h5ai _h5ai.footers.html _h5ai.headers.md
    ```
    如果你这样设置,默认是所有的文件夹页面都显示一样的。如果你想某个显示不一样的,放在那个文件夹里面就行了。

    另外我发现_h5ai.headers.html 和 _h5ai.footers.html 是显示在文件列表的上面和下面,而不是真正的页面上面和下面,所以你可能需要一个 CSS 来改动一下实际的样式·

    PS: 这两个文件不是下载下来自带的,需要的话自己创建
    SharkIng
        9
    SharkIng  
       Feb 28, 2017
    @SharkIng 如果你要在根目录下用的话,需要加's'好像
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1095 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 18:04 · PVG 02:04 · LAX 11:04 · JFK 14:04
    ♥ Do have faith in what you're doing.