1

I am working on a Comic Site project based on https://github.com/chrisanthropic/comical-jekyll-theme.

I am lookin for a way to display: comic->subcomics->episode->.jpg files.

Currently the theme supports only viewing of episode->.jpg files.

Tree Structure defined:

  • Firstly I created a folder called '_category' at the root of the site.
  • Created 3 new folder 'main-comic-1' 'main-comic-2' 'main-comic-3'.
  • Under each main-comic folder there will be 'sub-comic-1' 'sub-comic-2' folders.
  • Under each sub-comic folder there will be 'episode-1' episode-2' folders.
  • These episode folder will have respective .html files to display the comic images in grid view. Requirement: need to display like this: root/ └── _category/ ├── main-comic-1 │ ├── sub-comic-1 │ │ ├── episode-1 │ │ └── episode-2 │ ├── sub-comic-2 │ ├── episode-1 │ └── episode-2 ├── main-comic-2 │ ├── sub-comic-1 │ │ ├── episode-1 │ │ └── episode-2

Help:

Which files do i need to edit / add new to acheive a category, sub-category, episode page view based on the number of folders present in '_category'

captv89
  • 11
  • 1

1 Answers1

0

I asked similar questions before:

Those approaches will work, but honestly they felt a little messy. Eventually I went with a dumber approach of manually using a where to create my pages.

This code, which I put inside an include file, will find a post or category that matches a URL:

{% assign post = site.posts | where:"url", include.url | first %}
{% unless post %}
    {% assign post = site.pages | where:"url", include.url | first %}
{% endunless %}
// code for rendering link to post

Then I just call something like this whenever I want to show a link to a page:

{% include url-thumbnail.html url="/path/to/file/here" %}

I guess you should go with the first approaches if you have thousands of files, or the manual approach if you have a more manageable amount of files.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107