Improve mobile title display

Also fixed the 404 page title on mobile screens
This commit is contained in:
Cotes Chung 2021-12-02 21:18:18 +08:00
parent b518c9d3bc
commit 3caacbee61
3 changed files with 4 additions and 9 deletions

View file

@ -136,7 +136,6 @@ defaults:
values:
layout: page
permalink: /:title/
dynamic_title: true # Hide title in mobile screens.
sass:
style: compressed

View file

@ -50,7 +50,7 @@
<div id="topbar-title">
{% if page.layout == 'home' %}
{{- site.data.locales[lang].title | default: site.title -}}
{% elsif page.collection == 'tabs' %}
{% elsif page.collection == 'tabs' or page.dynamic_title %}
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
{% else %}

View file

@ -9,14 +9,10 @@ layout: default
<!-- core -->
<div id="core-wrapper" class="col-12 col-lg-11 col-xl-8">
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
{% if page.dynamic_title %}
{% if page.dynamic_title or page.collection == 'tabs' %}
<h1 class="dynamic-title">
{% if page.collection == 'tabs' %}
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
{% else %}
{{- page.title -}}
{% endif %}
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
</h1>
<div class="post-content">
{% include refactor-content.html content=content %}