自定义 Trac:删除标准页脚

发布于 2024-07-25 04:58:43 字数 591 浏览 3 评论 0原文

我们使用托管 Trac。 它使用 Genshi 模板。 我想我们可以提交我们自己的site.html。 我们想要摆脱 Trac 标准页脚。 最优雅的方式是什么?

我怀疑答案就在源氏的一些绝妙的把戏中。 我不知道 Genshi 也不知道 Trac 对此有何补充。 我凭直觉尝试了一些方法,但没有成功。

我试过 css

 <style type="text/css">
     #footer 
     {
         visibility:hidden;
     }
 </style>

没问题,除非你想使用自己的页脚(称为“#sitefooter”)。 这个位于“#footer”之后,隐藏页脚会留下难看的空白。

然后我尝试了 jquery:

<script>
 jQuery(document).ready(function($) { $("#footer").text(''); });
</script>

这很好,但我不确定 jquery 的支持到底有多广泛。

We use hosted Trac.
It uses Genshi templates.
I think we can submit our own site.html.
We want to get rid of Trac standard footer.
What is the most elegant way of doing that?

I suspect that the answer is in some nice Genshi trick.
I don't know Genshi nor Trac's additions to it.
I tried couple of things on a hunch, none worked.

I tried css

 <style type="text/css">
     #footer 
     {
         visibility:hidden;
     }
 </style>

That is ok, unless you want to use your own footer (called "#sitefooter").
This one comes after "#footer", and hiding footer leaves an ugly white space.

Then I tried jquery:

<script>
 jQuery(document).ready(function($) { $("#footer").text(''); });
</script>

This is fine yet I am not sure how wide support for jquery really is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

仙气飘飘 2024-08-01 04:58:43

最优雅的方法是在 trac.ini 中更改它。
页脚在 trac.ini 中设置,这是默认设置:

[project]
footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>

The most elegant way is to just change it in trac.ini.
The footer is set in in trac.ini, and this is the default:

[project]
footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>
听你说爱我 2024-08-01 04:58:43

最优雅的方法是修改

/path-to-trac/projectname/templates/

示例 site.html 文件下的 site.html:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" py:strip="">
<!--! Custom match templates go here -->
<div py:match="div[@id='footer']">
    <!-- put custom footer markup here -->
</div>
</html>

归功于 marcin。

Most elegant way is to modify site.html under

/path-to-trac/projectname/templates/

Example site.html file:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" py:strip="">
<!--! Custom match templates go here -->
<div py:match="div[@id='footer']">
    <!-- put custom footer markup here -->
</div>
</html>

Credit to marcin.

指尖微凉心微凉 2024-08-01 04:58:43

目前我身上没有最新的 trac 副本,无法深入了解模板,但对于 CSS,您想尝试

display: none;
margin: 0;
padding: 0;

而不是

visibility:hidden;

可见性隐藏项目仍然占用空间。

I don't have a recent copy of trac on me at present to poke into as far as templates go, but for CSS, you want to try

display: none;
margin: 0;
padding: 0;

instead of

visibility:hidden;

visibility hidden items still take up space.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文