NotionNext icon indicating copy to clipboard operation
NotionNext copied to clipboard

【Need Help】The title of the article is displayed above the picture in the recommended articles

Open vlafriday opened this issue 1 year ago • 8 comments

Discussed in https://github.com/tangly1024/NotionNext/discussions/1936

Originally posted by vlafriday March 2, 2024 Hello, I have a preview with the text in the recommended articles on the post page. But the title of the article is displayed above the picture. I wanted to ask if I can disable the display of text above the preview. So that only the picture is visible. Where is it configured?

Here https://www.vlafriday.space/my-set-for-a-25-year-old-grandfather

Screenshot Screenshot_711

vlafriday avatar Mar 02 '24 04:03 vlafriday

Hi, currently there is no toggle to control whether the text is displayed here, but you can easily modify a piece of code to achieve the requirement of hiding the text.

The relevant code is located here: https://github.com/tangly1024/NotionNext/blob/80a7a9b2d8e901faec5f010229c05b83ad6e2ead/themes/hexo/components/ArticleRecommend.js#L49-L51

Simply add invisible or hidden to the className, and the text will be hidden.

image

image

tangly1024 avatar Mar 04 '24 06:03 tangly1024

Thanks a lot, very helpful 👍

vlafriday avatar Mar 04 '24 07:03 vlafriday

@tangly1024 how can I add a shadow to this picture? to make the white text better visible in a light picture Screenshot_26

vlafriday avatar Mar 04 '24 07:03 vlafriday

before pointing the mouse at the picture

vlafriday avatar Mar 04 '24 07:03 vlafriday

Adding a brightness-75 will be helpful:

https://github.com/tangly1024/NotionNext/blob/695fca0dac2db3a6bfe8643f260862641d741d70/themes/hexo/components/ArticleRecommend.js#L47-L54

image

This will better highlight white text: image

Brightness defaults to these options: image

tangly1024 avatar Mar 05 '24 07:03 tangly1024

@tangly1024 but how can I add a shadow to the picture? Not the brightness

vlafriday avatar Mar 05 '24 16:03 vlafriday

Adding a shadow-xl will be helpful:

https://github.com/tangly1024/NotionNext/blob/695fca0dac2db3a6bfe8643f260862641d741d70/themes/hexo/components/ArticleRecommend.js#L45!

改为:

className="shadow-xl flex h-40 cursor-pointer overflow-hidden"

image

tangly1024 avatar Mar 06 '24 03:03 tangly1024

@tangly1024 I did this, but the image still has no shadow :(

The shadow is not needed for the text. The shadow is needed for the image

Screenshot_28

vlafriday avatar Mar 06 '24 06:03 vlafriday