Refactor the page layout

This commit is contained in:
Cotes Chung 2021-12-13 21:55:19 +08:00
parent a403ffee42
commit 3342abc9e6
2 changed files with 17 additions and 14 deletions

View file

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

View file

@ -1,5 +1,6 @@
--- ---
layout: page layout: page
refactor: true
pannel_includes: pannel_includes:
- toc - toc
tail_includes: tail_includes: