mmistakes / jekyll-theme-basically-basic

Your new Jekyll default theme.

Home Page:https://mmistakes.github.io/jekyll-theme-basically-basic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extra spacing in post lists?

TheNewbieWoodworker opened this issue · comments

I figured I'd post this here instead of the jekyll talk forum, because I think it has to do with styling, which I figure is probably specific to this theme. But if you think others would benefit from this, I'd be happy to repost it to the talk forum - just say the word.

I'm getting extra vertical spacing after each post's "Read More >>", in a page I'm working on. You can see it here: https://thenewbiewoodworker.com/poweredup/

I'm sure there's a better way to do this, but I'm still learning. Feel free to offer improvements.

My page file (poweredup.md) looks like this:

---
layout: page
title: "Powered Up Blog Posts"
permalink: "/poweredup/"
---

{% include powered-up-posts.md sortOrder="asc" %}

Or, of course, this (poweredupdescending.md):

---
layout: page
title: "Powered Up Blog Posts"
permalink: "/poweredup/descending/"
---

{% include powered-up-posts.md sortOrder="desc" %}

Here's the include file:

### Here's my blog posts for Steve Ramsey’s [“Powered Up”](https://theweekendwoodworker.com/powered-up){:target="_blank"} online course:

{% if include.sortOrder == "desc" %}
#### Oldest First | [Show Newest First](/poweredup/)

---

  {% for post in site.categories.PoweredUp reversed %}
    {% include entry.html %}
  {% endfor %}
{% else %}
#### Newest First | [Show Oldest First](/poweredup/descending/)

---

  {% for post in site.categories.PoweredUp %}
    {% include entry.html %}
  {% endfor %}
{%endif %}

What am I doing wrong, that causes the extra vertical spacing after each post's "Read More >>"?

Thanks!

Not exactly sure what you did to break it, but from the looks of it something changed with the HTML markup.

This is where your web browser's developer tools inspector becomes your friend. If you look at the unmodified Basically Basic demo site, you'll see the read more links have some CSS.

.entries-list .entry-excerpt > :last-child {
    margin-bottom: 0;
}

image

This declaration removes the bottom margin on the last <p> inside of <div class="entry-excerpt">.

In your modified site there is no margin-bottom: 0 being applied, which is why you have the extra space.

image

As far as I can tell you changed some class names (missing <div class="entries-list"></div> wrapper is likely the problem), which broke the CSS.

Thanks. I didn't change anything, that should affect this - the posts list on the home page are fine. But:

I was thinking I had done something obviously wrong, and you've helped refocus me on the actual problem, which is figuring out what's different between what the "home" layout generated, vs. what this generated.

So, armed with that, I'll figure it out. Thanks!

As mentioned above, you're missing <div class="entries-list"></div> around the post entries. This class is needed to get the styling that removes the bottom margin.

I didn't look through your files, but somewhere in there it was either omitted or you're using a different include that doesn't have it.

Your site:

image

BB demo site:

image

Thanks I truly appreciate the help. I would have eventually gotten there, but it's a lot nicer when someone who knows there way around does it.

NEXT time, I'll use a good file compare program and compare sections of the generated HTML. I'm learning, but not as quickly as I'd like.