Comments (4)
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.
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).
from chulapa.
@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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chulapa.