Jieiku / abridge

Fast & Lightweight Zola Theme
https://abridge.pages.dev/
MIT License
142 stars 41 forks source link

Separate posts in the main index page #130

Closed wewlad-dev closed 11 months ago

wewlad-dev commented 11 months ago

I am repurposing this theme as a portfolio (not primarily as a blog), and part of that is I have two separate categories that I need to have them in the main page. While everything else worked, refactoring some components and creating some templates/css, the only issue I am having now is separating a two categories of posts I have, call them "folder 1" and "folder 2" posts, as I am using the "TOS" class on the main page to list these posts as the image below, obviously after creating new different classes for each.

Screenshot_6

As you can see, both are listing the same posts.. now I already have separate folder for each category of these posts, except it stills iterate through all folders in contents, not within their scope, if that make sense. So the end goal is to have something like this Screenshot_7 where folder 1 is ~/contents/folder_1 and folder 2 is ~/contents/folder_2 Now looking in the index page, it seems this is what iterate through the posts {%- for page in section_item.pages | slice(end=recent_items) %} {{- page_macros::page_listing(page=page, config=config) }}

But beyond that I am lost on what to do, any idea?

wewlad-dev commented 11 months ago

Ok got it solved, Simply by moving the {%- set section_item = get_section(path= into the class of each box above, and each will iterate only those in that specific folder inside content path.

Jieiku commented 11 months ago

was just going to suggest that this should be pretty straight forward with sections.

I am actually planning to create a landing page that may do something similar to what your doing now: https://github.com/Jieiku/abridge/issues/129

I am happy you are finding Abridge useful. I forked abridge.css from bamboo and have been evolving it to try and make it more flexible and efficient. (which reminds me that I need to update that repo, all the work for it takes place in this zola theme first.)

wewlad-dev commented 11 months ago

That would be super awesome, can't wait to see how it looks! The one I modified it lists my projects but in different categories on the landing page, it will do the job in the meantime.

And yeah I love this theme and Zola in general, I already used it for my blog but wanted something as a portfolio too, and no other theme satisfied that so decided to reuse this theme since I'm already familiar with it.

Funnily enough, I made my new -now old- portfolio 3 weeks ago using React/Gatsby and was happy with it back then, but after trying Zola and this theme, performance wise is unmatched, not to mention that you can use the site with JavaScript disabled too -I'm sure a lot of users hate the current state of modern sites anyway-, so decided to redo the portfolio again with Zola/Abridge! :)