Simplify layout logic

This commit is contained in:
Maruan Al-Shedivat 2020-05-17 05:52:09 -04:00
parent 097a32a680
commit b6543ef41e
2 changed files with 36 additions and 29 deletions

View File

@ -1,32 +1,44 @@
--- ---
layout: page layout: default
--- ---
<div class="row"> <div class="post">
<div class="col">
{{ content }} <header class="post-header">
</div> {% assign name = site.title | split: ' ' %}
{% if page.profile %} <h1 class="post-title"><span class="font-weight-bold">{{ name | first }}</span> {{ name | last }}</h1>
<div class="profile col-4 {% if page.profile.align == 'left' %}order-first{% endif %}"> <p class="post-description">{{ page.description }}</p>
{% if page.profile.image %} </header>
<img class="img-fluid z-depth-1 rounded" src="{{ page.profile.image | prepend: '/assets/img/' | relative_url }}">
{% endif %} <article>
{% if page.profile.address %} <div class="row">
<div class="address"> <div class="col">
{{ page.profile.address }} {{ content }}
</div>
{% if page.profile %}
<div class="profile col-4 {% if page.profile.align == 'left' %}order-first{% endif %}">
{% if page.profile.image %}
<img class="img-fluid z-depth-1 rounded" src="{{ page.profile.image | prepend: '/assets/img/' | relative_url }}">
{% endif %}
{% if page.profile.address %}
<div class="address">
{{ page.profile.address }}
</div>
{% endif %}
</div> </div>
{% endif %} {% endif %}
</div>
{% if page.news %}
{% include news.html %}
{% endif %}
{% if page.social %}
<div class="social">
{% include social.html %}
<div class="contact-note">{{ site.contact_note }}</div>
</div> </div>
{% endif %} {% endif %}
</div> </article>
{% if page.news %}
{% include news.html %}
{% endif %}
{% if page.social %}
<div class="social">
{% include social.html %}
<div class="contact-note">{{ site.contact_note }}</div>
</div> </div>
{% endif %}

View File

@ -4,12 +4,7 @@ layout: default
<div class="post"> <div class="post">
<header class="post-header"> <header class="post-header">
{% if page.title == 'about' %}
{% assign name = site.title | split: ' ' %}
<h1 class="post-title"><span class="font-weight-bold">{{ name | first }}</span> {{ name | last }}</h1>
{% else %}
<h1 class="post-title">{{ page.title }}</h1> <h1 class="post-title">{{ page.title }}</h1>
{% endif %}
<p class="post-description">{{ page.description }}</p> <p class="post-description">{{ page.description }}</p>
</header> </header>