From: Michael D. Lowis
Date: Tue, 16 Jun 2020 10:57:18 +0000 (-0400)
Subject: added tag count to the datalist entries
X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=93cf9ffed891516f566c1b0a4a22ab8ea3464a20;p=projs%2Fawiki.git
added tag count to the datalist entries
---
diff --git a/awiki.rb b/awiki.rb
index a44f89f..b58ef9c 100755
--- a/awiki.rb
+++ b/awiki.rb
@@ -182,15 +182,19 @@ def gensitemap()
f.puts ""
f.puts "
"
f.puts ""
- tags = []
+ tags = {}
$db[:pages].values.filter{|h| h[:title] }.sort_by{|h| h[:title] }.each do |p|
- tags += p[:tags]
+ (p[:tags] || []).each do |t|
+ tags[t] ||= 0
+ tags[t] += 1
+ end
f.puts "- #{p[:title]}
"
end
f.puts "
"
f.puts "\n\n#{SEARCH_SCRIPT}
"
- f.puts "