Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第154页代码勘误:《Django企业开发实战》2020年3月河北第6次印刷 #44

Open
MaoningGuan opened this issue Jun 14, 2020 · 0 comments

Comments

@MaoningGuan
Copy link

MaoningGuan commented Jun 14, 2020

问题阐述:

当访问首页时,标签的标题没有显示为:首页 - typeidea 博客系统

问题解决:

1、修改base.html的代码:

<title>{% block title %}首页{% endblock %}- typeidea 博客系统</title>

修改为:

<title>{% block title %}{% endblock %}- typeidea 博客系统</title>

2、修改list.html代码:

{% block title %}
    {% if tag %}
    标签页:{{ tag.name }}
    {% elif  category %}
    分类页:{{ category.name }}
    {% endif %}
{% endblock %}

修改为:

{% block title %}
    {% if tag %}
    标签页:{{ tag.name }}
    {% elif  category %}
    分类页:{{ category.name }}
    {% else %}
    首页
    {% endif %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant