jez / hpstr-theme

A Medium-like Octopress theme based on the HPSTR Jekyll theme.
GNU General Public License v3.0
63 stars 15 forks source link

Post featured image #19

Closed fjcaetano closed 7 years ago

fjcaetano commented 9 years ago

Is there a reason why featured images for each post are not in the index? Would it be interesting?

I got it working on my fork: Live Version

jez commented 9 years ago

Nice!

I think it's mostly just because I tend to use the same image for most posts, and they're almost always not related to the content of the post.

fjcaetano commented 9 years ago

Hold on, don't close this issue yet! I'll submit the pull-request to "fix" this.

jez commented 9 years ago

Ok, sure. As long as it's opt-in, not opt-out. There should be something like a flag: in_index: true that defaults to false.

fjcaetano commented 9 years ago

The way I made it, if the user sets a feature image for a post, it will appear in the index. That means that if he doesn't set the image per post, it won't have any.

Is that what you want to change, to make the user set a feature image per post AND add that in_index option?

jez commented 9 years ago

Yeah, for example, I have lots of feature images, on my blog, but I don't want any of them to show up in my index. I want it to be a feature that is there only if users enable it.

Also feel free to change is_index to something that makes more sense if you want.

fjcaetano commented 9 years ago

Ok, sure. All do that

jez commented 9 years ago

Also please add a section to this doc documenting how it works:

https://github.com/jez/hpstr-theme/blob/master/Properties.md#per-page-properties-page

jez commented 9 years ago

Now that I think about it, you might also want to add and check a site.xyz property that lets you configure it on a site-wide level, so that it's easy for people who disagree with my tastes and want it default-on. Something like

if (page.is_index == true) || (page.is_index != false && site.is_index == true)

which would let you enable or disable it for the entire site, override that preference on a page-by-page basis, and fall back to no image if neither setting had been explicitly set to true.