Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Help: How to show Subcategories & their Episodes #5

Open
captv89 opened this issue Jan 25, 2018 · 2 comments
Open

Help: How to show Subcategories & their Episodes #5

captv89 opened this issue Jan 25, 2018 · 2 comments

Comments

@captv89
Copy link

captv89 commented Jan 25, 2018

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

@chrisanthropic
Copy link
Owner

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.

@captv89
Copy link
Author

captv89 commented Jan 29, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants