chesterhow / tale

Minimal Jekyll theme for storytellers
http://chesterhow.github.io/tale
MIT License
960 stars 863 forks source link

Post title with background image #27

Closed GammaGames closed 6 years ago

GammaGames commented 6 years ago

Overall this is my favorite theme so far, but I'm curious how difficult it would be to modify a post to use an image in the background of a post title, similar to the screenshot below (from janczizikow/sleek/)

image

chesterhow commented 6 years ago

Hey @GammaGames really glad you like the theme! Hmm I think it shouldnt be too difficult to implement something like that. But i’m not sure about how familar you are with CSS?

What i would do is wrap the title and date in a div. Within this div i’ll also include an img tag with my desired background. Then i’ll use the position: absolute property to sorta make the image occupy the “background” of the div.

GammaGames commented 6 years ago

I know a good bit of CSS, I'm just not sure how to modify jekyll themes. I think it would be nice to be able to add an optional img value in the front matter. If the value is there it would do some custom css with the image (maybe even using parallax.js to make it look nicer). I'll probably play with it a little when I have time next week, thank you!

I'd also like to add tags, I have a bit to learn haha

chesterhow commented 6 years ago

Hmm, currently I don't think there is a huge demand for the img feature sorry :( But if you would like an example of how to use images in the front matter you can check out my other blog - https://github.com/bottleneckco/heritage-sg. Its built with the Tale theme too and I'm using images in the front matter there. Hope it serves as a useful reference! :)

GammaGames commented 6 years ago

Thank you, it does! That's a very nice theme as well! Feel free to close if you'd like :)

chesterhow commented 6 years ago

Alright, feel free to ask me again if you need help! 😊

GammaGames commented 6 years ago

I found a nice alternative I'm gonna try out, based on Hyde. I can use a sidebar and set its background to whatever the post's featuredImage variable is.

image

I've still got a bit of customizing to go before I'll be happy with it, but I think it's a nice clean middle ground. Thanks again!

chesterhow commented 6 years ago

Oh nice! Hyde is one of my favs too 👍