Giter VIP home page Giter VIP logo

Comments (9)

mythmon avatar mythmon commented on August 19, 2024

I am not sure that "vary-on" is the best name for this thing. Any other ideas?

from wok.

thedjpetersen avatar thedjpetersen commented on August 19, 2024

This would in effect provide pseudo filtering correct?

from wok.

thedjpetersen avatar thedjpetersen commented on August 19, 2024

I think another way to phrase it would be 'filter-by'.

from wok.

thedjpetersen avatar thedjpetersen commented on August 19, 2024

It would only be single tag filtering? I don' think that is such a bad idea, the difficult thing is if you want to provide and combination of tags to filter by, I think the permutations for that could get rather large. Even though the code might be pretty fun to write.

Would an example URL structure look like this:

/blog/category/sports or /blog/category/sports+computers ?

from wok.

mythmon avatar mythmon commented on August 19, 2024

The result would look something like filtering, yes, but from the stand point of the file being edited, it is more like a map() than a filter(). I think 'filter-by' makes me think of somehow filtering a list, instead of working my way through it.

from wok.

mythmon avatar mythmon commented on August 19, 2024

Some clarification on this. Lets say I want to filter by tags (which is probably the most obvious thing this system could do). I would make this content item

title: Filter by Tag
vary-on: site.tags
type: varytags
url: /filter/tags/{vary-item}.html
---

And the template varytags.html

{% extend base.html %}
<h1>All pages with tag {{ vary-item }}</h1>
<ul>
{% for subpage in site.tags[vary-item] %}
    <li><a href="{{ subpage.url }}">{{ subpage.title }}</a></li>
{% endfor %}
</li>

This would generate one file per tag. So if you have tags linux, wok, hamper, then the pages /filter/tags/linux.html, /filter/tags/wok.html, /filter/tags/hamper.html would be generated, and each one would have a list of all pages with that tag.

from wok.

mythmon avatar mythmon commented on August 19, 2024

Moving this to milestone 1.0

from wok.

mythmon avatar mythmon commented on August 19, 2024

See 461f553 for an initial implementation.

from wok.

edunham avatar edunham commented on August 19, 2024

Closing because it was implemented over 2 years ago. If it's broken, someone will file a new issue :)

from wok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.