Skip to content

Commit

Permalink
use latest header file
Browse files Browse the repository at this point in the history
  • Loading branch information
engn33r committed May 3, 2024
1 parent 2ee72ef commit d5761af
Showing 1 changed file with 9 additions and 46 deletions.
55 changes: 9 additions & 46 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<!-- TODO this file has become a mess, refactor it -->

{% assign date_format = site.date_format | default: "%B %-d, %Y" %}

{% if page.cover-img or page.title %}

{% if page.cover-img %}
<div id="header-big-imgs" data-num-img={% if page.cover-img.first %}{{ page.cover-img.size }}{% else %}1{% endif %}
{% for bigimg in page.cover-img %}
{% assign imgnum = forloop.index %}
{% for imginfo in bigimg %}
{% if imginfo[0] %}
{% if imginfo[0] %}
data-img-src-{{ imgnum }}="{{ imginfo[0] | absolute_url }}"
data-img-desc-{{ imgnum }}="{{ imginfo[1] }}"
{% else %}
Expand All @@ -21,42 +17,8 @@
{% endif %}

<header class="header-section {% if page.cover-img %}has-img{% endif %}">
{% if page.cover-img %}
<div class="big-img intro-header">
<div class="container-md">
<div class="row">
<div class="col-xl-8 offset-xl-2 col-lg-10 offset-lg-1">
<div class="{{ include.type }}-heading">
<h1>{% if page.title %}{{ page.title | strip_html }}{% else %}<br/>{% endif %}</h1>
{% if page.subtitle %}
{% if include.type == "page" %}
<hr class="small">
<span class="{{ include.type }}-subheading">{{ page.subtitle | strip_html }}</span>
{% else %}
<h2 class="{{ include.type }}-subheading">{{ page.subtitle | strip_html }}</h2>
{% endif %}
{% endif %}

{% if include.type == "post" %}
<span class="post-meta">Posted on {{ page.date | date: date_format }}</span>
{% if page.last-updated %}
<span class="post-meta">
<span class="d-none d-md-inline middot">&middot;</span>
Last updated {{ page.last-updated | date: date_format }}
</span>
{% endif %}
{% if page.readtime %}
{% include readtime.html %}
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
<span class='img-desc'></span>
</div>
{% endif %}
<div class="intro-header no-img">
<div class="intro-header {% if page.cover-img %} big-img {% endif %}">
{% if page.cover-img or page.title %}
<div class="container-md">
<div class="row">
<div class="col-xl-8 offset-xl-2 col-lg-10 offset-lg-1">
Expand All @@ -72,6 +34,9 @@ <h2 class="{{ include.type }}-subheading">{{ page.subtitle | strip_html }}</h2>
{% endif %}

{% if include.type == "post" %}
{% if page.author %}
By <strong>{{ page.author | strip_html }}</strong><br>
{% endif%}
<span class="post-meta">Posted on {{ page.date | date: date_format }}</span>
{% if page.last-updated %}
<span class="post-meta">
Expand All @@ -87,6 +52,8 @@ <h2 class="{{ include.type }}-subheading">{{ page.subtitle | strip_html }}</h2>
</div>
</div>
</div>
{% endif %}
{% if page.cover-img %}<span class='img-desc'></span>{% endif %}
</div>

{% if page.header-extra %}
Expand All @@ -95,8 +62,4 @@ <h2 class="{{ include.type }}-subheading">{{ page.subtitle | strip_html }}</h2>
{% endfor %}
{% endif %}

</header>

{% else %}
<div class="intro-header"></div>
{% endif %}
</header>

0 comments on commit d5761af

Please sign in to comment.