Path: blob/main/_plugins/gtn/synthetic.rb
1677 views
# frozen_string_literal: true12require './_plugins/jekyll-topic-filter'34module Jekyll5module Generators6# Generates synthetic topics from tutorials with specific tags7class SyntheticTopicGenerator < Generator8def generate(site)9# Full Bibliography10Jekyll.logger.info '[GTN/SyntheticTopics] Generating Indexes'1112Gtn::TopicFilter.list_topics(site).select { |t| site.data[t]['tag_based'] }.each do |topic|13Jekyll.logger.debug "[GTN/SyntheticTopics] Creating #{topic} topic"1415topic_index = PageWithoutAFile.new(site, '', "topics/#{topic}", 'index.md')16topic_index.content = ''17topic_index.data['layout'] = 'topic'18topic_index.data['topic_name'] = topic19site.pages << topic_index2021# For now, intentionally no FAQ22# faq_index = PageWithoutAFile.new(site, "", "topics/#{topic}/faqs", "index.md")23# faq_index.content = ""24# faq_index.data["layout"] = "faq-page"25# site.pages << faq_index26end27end28end29end30end313233