comical-jekyll-theme icon indicating copy to clipboard operation
comical-jekyll-theme copied to clipboard

Help: How to show Subcategories & their Episodes

Open captv89 opened this issue 7 years ago • 2 comments

Hi.. First off thank you for this amazing work. I would appriciate your help in regards to my case. I have main comics and few subcomics under them which has 1 or 2 episodes under each subcategory. Can you please tell me which file to edit inorder to achieve this.

So in the Archives section it would be like:

MAIN COMIC 1: -SUBCOMIC 1: -EPISODE 1 -EPISODE 2 MAIN COMIC 2: -SUBCOMIC 1: -EPISODE 1 -EPISODE 2

captv89 avatar Jan 25 '18 13:01 captv89

Hi, thanks for the kind words about the theme. I haven't worked on this theme in quite some time (and am slowly porting it to Hugo) but you could modify this file to edit the archives page. Specifically, this is the block that loops through the comic based on the category:

    {% for post in site.categories.[page.category] %}
      {% if post.thumbnail %}
	<div class="small-4 large-3 column center-text left">
	  <a href="{{ site.baseurl }}{{ post.url }}">
	    <figure>
	      <img src="{{ site.baseurl }}{{ post.thumbnail }}" class="center"/><figcaption>{{ post.title }}</figcaption>
	    </figure>
	  </a>
	</div>
      {% endif %}
{% endfor %} 

Adding something like subcat to the yaml front-matter of the post and then try adding another loop to the archives page, something like

    {% for post in site.categories.[page.subcat] %}
      {% if post.thumbnail %}
	<div class="small-4 large-3 column center-text left">
	  <a href="{{ site.baseurl }}{{ post.url }}">
	    <figure>
	      <img src="{{ site.baseurl }}{{ post.thumbnail }}" class="center"/><figcaption>{{ post.title }}</figcaption>
	    </figure>
	  </a>
	</div>
      {% endif %}
{% endfor %} 

Will get the images displayed on the archives page in the correct order. You'll probably want to restyle the page a bit after that though.

chrisanthropic avatar Jan 25 '18 19:01 chrisanthropic

Thank you. Will trying editing the file mentioned above and few others to get the required output :)

captv89 avatar Jan 29 '18 12:01 captv89