这是我用pelican使用pelican-bootstrap3模板创建的未完成的站点:http://snoek.ddns.net/~oliver/mysite/
在pelican-bootstrap3自述文件中,它说可以使用pelicanconf.py文件中的头像变量来指向图像。我已经这样做了,但现在我的照片出现在每一页上,这有点可笑。我希望它只在我的“关于”页面上。
在pelican-themes/pelican-bootstrap3/templates/includes中,我发现了一个包含以下内容的aboutme.html文件:
<div id="aboutme">
{% if AVATAR %}
<p>
<img width="100%" class="img-thumbnail" src="{{ SITEURL }}/{{ AVATAR }}"/>
</p>
{% endif %}
{% if ABOUT_ME %}
<p>
<strong>{{ _('About') }} {{ AUTHOR }}</strong><br/>
{{ ABOUT_ME }}
</p>
{% endif %}
</div>也许是这个文件可以编辑,以指定头像应该只显示在“关于”页面上?但我不确定是怎么做到的。
发布于 2017-07-11 08:19:32
变化
{% if AVATAR %}至
{% if page and page.title == 'About' and (ABOUT_ME or AVATAR) %}https://stackoverflow.com/questions/45008414
复制相似问题