LouisBarranqueiro / hexo-theme-tranquilpeak

:lipstick: A gorgeous responsive theme for Hexo blog framework
https://louisbarranqueiro.github.io/hexo-theme-tranquilpeak/
GNU General Public License v3.0
1.86k stars 484 forks source link

Setting thumbnail_image_position to 'bottom' makes a smaller empty line #652

Closed chrisjwelly closed 4 years ago

chrisjwelly commented 4 years ago

Description

The default configuration for thumbnail_image_position is right. I changed this to bottom in order remove the seemingly empty space on the right side. I have written several paragraph of my posts, and I separate my paragraphs with an empty line. When I am still using the default thumbnail_image_position to right, the empty lines are shown clearly, but upon changing to bottom, the empty lines looks like it is missing, presumably because the size is much smaller.

I notice that this only applies to my post which has a <!--more--> to create a post excerpt. By looking at the CSS using web developer tools, this seems to apply only to content of posts with the postShorten-except applied to it. I tried (temporarily) changing it to postShorten-content using the web developer tools, and it seems to look much better.

Expected behavior

When setting thumbnail_image_position to 'bottom', post excerpts should have a clearly visible empty lines.

Current Behaviour: image

Expectation (notice how the empty lines are much more visible): image

Steps to reproduce the bug

  1. Go to themes/tranquilpeak/_config.yml and change thumbnail_image_position to bottom.
  2. Create a new dummy post: hexo new post test-post-excerpt
  3. Write multiple paragraphs, separated by empty lines (example below)
  4. Insert a <!--more--> to turn it into a post excerpt
  5. Run hexo server to view the outcome
  6. Extra: Remove <!--more--> to turn this into a normal post without an excerpt to compare

Example text:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris volutpat aliquam eleifend. Curabitur bibendum, nulla eu convallis eleifend, ante risus pretium lacus, a facilisis lacus sapien vitae metus. Etiam ex sapien, blandit id ex ac, bibendum consequat diam. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris volutpat aliquam eleifend. Curabitur bibendum, nulla eu convallis eleifend, ante risus pretium lacus, a facilisis lacus sapien vitae metus. Etiam ex sapien, blandit id ex ac, bibendum consequat diam. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris volutpat aliquam eleifend. Curabitur bibendum, nulla eu convallis eleifend, ante risus pretium lacus, a facilisis lacus sapien vitae metus. Etiam ex sapien, blandit id ex ac, bibendum consequat diam. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris volutpat aliquam eleifend. Curabitur bibendum, nulla eu convallis eleifend, ante risus pretium lacus, a facilisis lacus sapien vitae metus. Etiam ex sapien, blandit id ex ac, bibendum consequat diam. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris volutpat aliquam eleifend. Curabitur bibendum, nulla eu convallis eleifend, ante risus pretium lacus, a facilisis lacus sapien vitae metus. Etiam ex sapien, blandit id ex ac, bibendum consequat diam. 
<!--more-->

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris volutpat aliquam eleifend. Curabitur bibendum, nulla eu convallis eleifend, ante risus pretium lacus, a facilisis lacus sapien vitae metus. Etiam ex sapien, blandit id ex ac, bibendum consequat diam. 

Environment

Additional information

I investigated the CSS of both postShorten-excerpt as well as postShorten-content, but I see almost no difference except for margin-top. Even when I made them consistent, it didn't fix the issue.

LouisBarranqueiro commented 4 years ago

👋 @chrisjwelly , thanks for the detailed report. I'm checking this out right now.

LouisBarranqueiro commented 4 years ago

I found why and implemented a fix. I will release a new version including this fix real soon :)

chrisjwelly commented 4 years ago

@LouisBarranqueiro Awesome! Thanks.

If you don't mind me asking, how did last-of-type fix the issue?

LouisBarranqueiro commented 4 years ago

@chrisjwelly sure 🙂 this CSS rule will remove the bottom margin of the last paragraph in the excerpt instead of (previously) removing the bottom margin of all paragraphs in the excerpt. last-of-type is a CSS selector to select the last element of type p in the excerpt (div).

chrisjwelly commented 4 years ago

@chrisjwelly sure 🙂 this CSS rule will remove the bottom margin of the last paragraph in the excerpt instead of (previously) removing the bottom margin of all paragraphs in the excerpt. last-of-type is a CSS selector to select the last element of type p in the excerpt (div).

I see, thank you very much!