gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
358 stars 140 forks source link

Wide date strings are always wrapped on posts page #128

Closed dchiquito closed 1 year ago

dchiquito commented 2 years ago

Even on the largest breakpoint, wide date strings like September 22, 2022 are always wrapped around to a new line: image Scaling the window smaller will eventually cause other dates to wrap, but September 22 specifically will never display normally.

yashmehrotra commented 2 years ago

@dchiquito Yeah, this issue is probably because of the way we format date. Do you think using the Sep 22, 2022/Oct 2, 2022 format will help ? I find it more pleasing to look at as well

@526avijitgupta What are your thoughts

dchiquito commented 2 years ago

I can't test right now, but IIRC the title div is set to width: 80%, which leaves 20% for the date. Adjusting that ratio a bit worked when I tested it, but it moves all the dates around.

I think the best way would be to flex-grow: 1 the title column, but shortening the date string would work as well

dchiquito commented 2 years ago

I can't test right now, but IIRC the title div is set to width: 80%, which leaves 20% for the date. Adjusting that ratio a bit worked when I tested it, but it moves all the dates around.

I think the best way would be to flex-grow: 1 the title column, but shortening the date string would work as well

526avijitgupta commented 2 years ago

@yashmehrotra Using the other date format sounds good to me

526avijitgupta commented 2 years ago

@dchiquito I'm fine with either solution. Using flex properties sounds ideal. In case you test it out and want to raise a PR, feel free to do so :)

dchiquito commented 1 year ago

I tried using flex-grow, but that caused all the dates to be right-aligned, which looked ugly. Instead I just experimented with lowering the post title width until it didn't wrap anymore. Very short dates would have a significant amount of padding on the right, but that's the cost of left-aligning.