Skip to content

Commit

Permalink
Page titles no longer contain the site name
Browse files Browse the repository at this point in the history
If a page has a specific title, `page_title` will contain this and only
this. If the page has no title, or is the homepage, `page_title` will be
`None`. The `<title>` tag will always display at least the site name.

All of the themes' base.html files have been updated accordingly.
  • Loading branch information
Sam Hatfield committed Dec 22, 2014
1 parent c560c45 commit 61173d1
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions mkdocs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def get_page_context(page, content, nav, toc, meta, config):
"""

if page.is_homepage or page.title is None:
page_title = config['site_name']
page_title = None
else:
page_title = page.title + ' - ' + config['site_name']
page_title = page.title

if page.is_homepage:
page_description = config['site_description']
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/amelia/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/bootstrap/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-3.0.3.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/cerulean/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/cosmo/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/cyborg/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/flatly/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/journal/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/mkdocs/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ base_url }}/{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/readable/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/readthedocs/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block htmltitle %}
<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
{% endblock %}

{# CSS #}
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/simplex/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/slate/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/spacelab/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/united/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/themes/yeti/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
Expand Down

0 comments on commit 61173d1

Please sign in to comment.