feat(faq): link siblings FAQs of same category

This commit is contained in:
Colin Darie 2024-04-22 16:43:57 +02:00
parent 1e3c70feb8
commit ae78224bac
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
5 changed files with 31 additions and 0 deletions

View file

@ -16,6 +16,12 @@ class FAQsLoaderService
FrontMatterParser::Parser.parse_file(file_path)
end
def faqs_for_category(category)
@faqs_by_path.values
.filter { |faq| faq[:category] == category }
.group_by { |faq| faq[:subcategory] }
end
private
def load_faqs