Skip to content

Commit 121fdd1

Browse files
AkarinZxzhih
authored andcommitted
improve: 在没有配置 subtitle 时主页标题后不显示分隔符
1 parent 171b83f commit 121fdd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

layout/_partials/head.swig

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<link rel="preconnect" href="//9qpuwspm.api.lncld.net">
3333
<link rel="preconnect" href="//gravatar.loli.net">
3434

35-
<title>{% if title %}{{ title }}{% else %}{{ config.title }}{% endif %} | {% if is_home() %}{{ config.subtitle }}{% else %}{{ config.title }}{% endif %}</title>
35+
<title>{% if title %}{{ title }}{% else %}{{ config.title }}{% endif %}{% if is_home() %}{% if config.subtitle %} | {{ config.subtitle }}{% endif %}{% else %} | {{ config.title }}{% endif %}</title>
3636

3737
<meta name="HandheldFriendly" content="True" />
3838
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
@@ -64,7 +64,7 @@
6464

6565
<meta property="og:site_name" content="{{ config.title }}">
6666
<meta property="og:type" content="{% if is_post() %}article{% else %}blog{% endif %}">
67-
<meta property="og:title" content="{% if title %}{{ title }}{% else %}{{ config.title }}{% endif %} | {% if is_home() %}{{ config.subtitle }}{% else %}{{ config.title }}{% endif %}">
67+
<meta property="og:title" content="{% if title %}{{ title }}{% else %}{{ config.title }}{% endif %}{% if is_home() %}{% if config.subtitle %} | {{ config.subtitle }}{% endif %}{% else %} | {{ config.title }}{% endif %}">
6868
<meta property="og:description" content="{% if is_post() %}{{ page.description }}{% else %}{{ config.description }}{% endif %}">
6969
<meta property="og:url" content="{{ config.url }}{{ url_for(page.path) }}">
7070

@@ -93,4 +93,4 @@
9393
{% endif %}
9494

9595
{# {% include "public/json-ld.swig" %} #}
96-
</head>
96+
</head>

0 commit comments

Comments
 (0)