From cfbdc421c2cdc597c7319ea9d37cb9244ac64887 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 11 Oct 2023 14:43:19 +0200 Subject: [PATCH] fix including tags --- _plugins/jekyll-topic-filter.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_plugins/jekyll-topic-filter.rb b/_plugins/jekyll-topic-filter.rb index 599df5daba5f70..8c507be261f69e 100644 --- a/_plugins/jekyll-topic-filter.rb +++ b/_plugins/jekyll-topic-filter.rb @@ -610,7 +610,7 @@ def self.list_videos(site) # def self.list_all_tags(site) materials = process_pages(site, site.pages) - materials.map { |x| (x['tags'] || []) }.flatten.sort.uniq + (materials.map { |x| x['tags'] || [] }.flatten + self.list_topics(site)).sort.uniq end def self.filter_by_topic(site, topic_name) @@ -639,8 +639,9 @@ def self.filter_by_tag(site, topic_name) # properly. materials = process_pages(site, site.pages) - # If there is nothing with that topic name, try generating it by tags. - resource_pages = materials.select { |x| (x['tags'] || []).include?(topic_name) } + # Select those with that topic ID or that tag + resource_pages = materials.select { |x| x['topic_name'] == topic_name } + resource_pages += materials.select { |x| (x['tags'] || []).include?(topic_name) } # The complete resources we'll return is the introduction slides first # (EDIT: not anymore, we rely on prioritisation!)