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="col">
{{ 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 class="post">
<header class="post-header">
{% assign name = site.title | split: ' ' %}
<h1 class="post-title"><span class="font-weight-bold">{{ name | first }}</span> {{ name | last }}</h1>
<p class="post-description">{{ page.description }}</p>
</header>
<article>
<div class="row">
<div class="col">
{{ 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>
{% 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>
{% 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>
{% endif %}

View File

@ -4,12 +4,7 @@ layout: default
<div class="post">
<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>
{% endif %}
<p class="post-description">{{ page.description }}</p>
</header>