From 5253e3866c5e186552abcadc2769dbb1bab6662f Mon Sep 17 00:00:00 2001 From: Jefferson Bledsoe Date: Mon, 4 Jul 2022 16:51:19 +0100 Subject: [PATCH] Markup home page content lists and tags as lists (#950) * Markup home page content lists and tags as lists * Fix styling after markup changes * Fix typo * fix a couple visual issues * make sure the divider line between posts shows up Co-authored-by: Dean Attali --- _layouts/home.html | 142 +++++++++++++++++---------------- assets/css/beautifuljekyll.css | 8 ++ 2 files changed, 83 insertions(+), 67 deletions(-) diff --git a/_layouts/home.html b/_layouts/home.html index 806aa7c..cab91a5 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -6,88 +6,96 @@ layout: page {% assign posts = paginator.posts | default: site.posts %} -
+ +
    {% for post in posts %} -
    +
  • +
    - {%- capture thumbnail -%} - {% if post.thumbnail-img %} - {{ post.thumbnail-img }} - {% elsif post.cover-img %} - {% if post.cover-img.first %} - {{ post.cover-img[0].first.first }} + {%- capture thumbnail -%} + {% if post.thumbnail-img %} + {{ post.thumbnail-img }} + {% elsif post.cover-img %} + {% if post.cover-img.first %} + {{ post.cover-img[0].first.first }} + {% else %} + {{ post.cover-img }} + {% endif %} {% else %} - {{ post.cover-img }} {% endif %} - {% else %} + {% endcapture %} + {% assign thumbnail=thumbnail | strip %} + + {% if site.feed_show_excerpt == false %} + {% if thumbnail != "" %} +
    + + Post thumbnail + +
    {% endif %} - {% endcapture %} - {% assign thumbnail=thumbnail | strip %} - - {% if site.feed_show_excerpt == false %} - {% if thumbnail != "" %} -
    - - Post thumbnail - -
    - {% endif %} - {% endif %} - - -

    {{ post.title | strip_html }}

    - - {% if post.subtitle %} -

    - {{ post.subtitle | strip_html }} -

    {% endif %} -
    - + +

    {{ post.title | strip_html }}

    - {% if thumbnail != "" %} -
    - - Post thumbnail + {% if post.subtitle %} +

    + {{ post.subtitle | strip_html }} +

    + {% endif %}
    -
    - {% endif %} - {% unless site.feed_show_excerpt == false %} - {% if thumbnail != "" %} -
    - - Post thumbnail - -
    - {% endif %} + -
    - {% assign excerpt_length = site.excerpt_length | default: 50 %} - {{ post.excerpt | strip_html | truncatewords: excerpt_length }} - {% assign excerpt_word_count = post.excerpt | number_of_words %} - {% if post.content != post.excerpt or excerpt_word_count > excerpt_length %} - [Read More] + {% if thumbnail != "" %} +
    + + Post thumbnail + +
    {% endif %} -
    - {% endunless %} - {% if site.feed_show_tags != false and post.tags.size > 0 %} -
    - Tags: - {% for tag in post.tags %} - {{- tag -}} - {% endfor %} -
    - {% endif %} + {% unless site.feed_show_excerpt == false %} + {% if thumbnail != "" %} +
    + + Post thumbnail + +
    + {% endif %} -
    +
    + {% assign excerpt_length = site.excerpt_length | default: 50 %} + {{ post.excerpt | strip_html | truncatewords: excerpt_length }} + {% assign excerpt_word_count = post.excerpt | number_of_words %} + {% if post.content != post.excerpt or excerpt_word_count > excerpt_length %} + [Read More] + {% endif %} +
    + {% endunless %} + + {% if site.feed_show_tags != false and post.tags.size > 0 %} +
    + Tags: + +
      + {% for tag in post.tags %} +
    • + {{- tag -}} +
    • + {% endfor %} +
    +
    + {% endif %} + +
  • + {% endfor %} -
+ {% if paginator.total_pages > 1 %}