Git Product home page Git Product logo

Comments (4)

cargocultprogramming avatar cargocultprogramming commented on June 3, 2024 1

Alright - solved this for me along the lines of the jekyll discussion linked above.

I added a custom filter like this:

module Jekyll
    module TagFilters
        def count_by_item(input)
            input = input.is_a?(String) ? input.split(',') : input
            counts = Hash.new(0)
            input.flatten.each do |name|
                name = name.strip
                counts[name] += 1
            end
            sorted_counts = counts.sort_by { |tag, count| -count }
            sorted_counts.to_h
        end
    end
end
Liquid::Template.register_filter(Jekyll::TagFilters)

Then in jekyll you can

{% assign tag_count = alldocs | map: 'tags' | count_by_item %}

Then you can loop over tag_count as now over grouptag and replace tag.name with tag[0] and tag.size with tag[1] and it's all there.

from chulapa.

dieghernan avatar dieghernan commented on June 3, 2024

This is happening in Jekyll >=4.1.0 due a change on behaviour (maybe we were leveraging on a bug for creating the cloud tag).

See jekyll/jekyll#8214

from chulapa.

dieghernan avatar dieghernan commented on June 3, 2024

@cargocultprogramming I just see as a solution either to downgrade to Jekyll 4.0.1 or less or try the solution based on plugins on jekyll/jekyll#8214 (comment)

from chulapa.

rykerwilliams avatar rykerwilliams commented on June 3, 2024

EDIT. Kept hacking it and I figured it out. I think i'm squared now.

Mainly didn't understand the jekyll I needed to put in my page and what to do.

For anyone that finds this, I went to the main chulapa repo and looked at the cloudtag.html file and used that in conjunction with the comment from @cargocultprogramming to make a functioning tags page.

Thanks!

from chulapa.

Related Issues (4)

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.