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

2017-02-26 18:59:27 +08:00
 closers

/* 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 ,但是首页没有啊,是不是还需要配置什么?有木有大大用过?

2683 次点击
所在节点    问与答
9 条回复
zrj766
2017-02-26 19:06:24 +08:00
底部没弄过,顶部可以试试 /_h5ai/private/php/pages/index.php
closers
2017-02-26 19:32:21 +08:00
@zrj766 我试过了,只在加载的时候显示,加载完后就没有了
Vicer
2017-02-27 02:31:00 +08:00
心疼你,这么久了,还没有正确答案,开始看到了,以为有人知道,就没回复。
最新版的在配置文件里有选项,配置一下就好,曾经这个问题也是烦了我几天,最后还是自己找出来的。
Vicer
2017-02-27 02:31:56 +08:00
看错了,回复错了,我还以为是标题,忽视上面的回复
SharkIng
2017-02-27 07:44:35 +08:00
有个 header 和 footer 的文件的
closers
2017-02-27 15:42:21 +08:00
@SharkIng h5ai-0.29.0 这最新版的没有啊,还是我姿势有问题?
closers
2017-02-27 15:50:56 +08:00
@Vicer 惊现大佬啊( loc
SharkIng
2017-02-28 07:05:10 +08:00
@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
2017-02-28 07:08:16 +08:00
@SharkIng 如果你要在根目录下用的话,需要加's'好像

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/343310

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX