Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: _includes/JB/list_item #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jbenet
Copy link

@jbenet jbenet commented Feb 13, 2012

(Aside: Jekyll Bootstrap is awesome!)

As I setup my blog, I encountered a use case where I was setting up special a page_list for a particular group of pages (for example, project pages). I wanted a sort of index behavior, where I could include more things, like page summaries, taglines, etc.

In essence, I boiled down what i wanted to do (and what enables me to do it) to the changes in this pull request.

I noticed that tags_list is a bit more complicated. perhaps list_item could be ammended? not sure which way to proceed here.

@plusjade
Copy link
Owner

@jbenet so is the ultimate goal to be able to use custom list_item formats on case-by-case basis? As per your example, you want to define a list_item structure for only the group 'project'. I think this functionality would be ideal.

With your updates, what I'm seeing is the ability to overwrite only the HTML output of the page_list helper. Whereas the current functionality of method overriding allows you to override the entire helper altogether. While the latter is more powerful, I actually think your solution is much easier, because 9/10 times the user just wants to change the HTML output.

Regarding the tags_list, yes its very different from pages because the way Jekyll stores tag data-structures changes based on where they are stored (as part of the entire site, or on a specific post).

Can you comment on what your ideal functionality would be and if you have any current proposals for doing so please pass them along! Thanks for your support.

@jbenet
Copy link
Author

jbenet commented Feb 13, 2012

@plusjade hey! thanks for the quick response!

is the ultimate goal to be able to use custom list_item formats on case-by-case basis?

Yeah, I expect having different groups of pages that require different types of indices.

Whereas the current functionality of method overriding allows you to override the entire helper altogether.

You can still override the whole helper (though my functionality operates at the "default page_list helper" level). The powerful functionality shouldn't be removed, since _includes/JB/list_item still has:

  {% if site.JB.list_item.provider == "custom" %}
      {% include custom/list_item %}
  {% else %}
       ....
  {% endif %}

To get an idea of my use case, check out gist.github.com/1820873. I set that up as an example for a friend (who hasn't switched over to JB yet), so it's a bit simplified, but you can see what I'm doing with it.

I think the general functionality should have sub-templates for the lists (and other composite includes), along with a way to map sets of pages to a custom templates (from the index page perhaps), whether it is by setting the group (as i did), or maybe even on a tag or category basis.

@groundh0g groundh0g added this to the v 0.5.0 milestone Apr 4, 2015
@groundh0g groundh0g self-assigned this Apr 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants