Skip to content

Commit

Permalink
fix including tags
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Oct 11, 2023
1 parent 143bd74 commit cfbdc42
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions _plugins/jekyll-topic-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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!)
Expand Down

0 comments on commit cfbdc42

Please sign in to comment.