@@ -238,7 +238,7 @@ def generate_articles(self, write):
238238 """Generate the articles."""
239239 for article in chain (self .translations , self .articles ):
240240 write (article .save_as , self .get_template (article .template ),
241- self .context , article = article , category = article .category )
241+ self .context , article = article , categories = article .categories )
242242
243243 def generate_direct_templates (self , write ):
244244 """Generate direct templates pages"""
@@ -328,7 +328,7 @@ def generate_context(self):
328328 continue
329329
330330 # if no category is set, use the name of the path as a category
331- if 'category ' not in metadata :
331+ if 'categories ' not in metadata :
332332
333333 if (self .settings ['USE_FOLDER_AS_CATEGORY' ]
334334 and os .path .dirname (f ) != article_path ):
@@ -340,7 +340,7 @@ def generate_context(self):
340340 category = self .settings ['DEFAULT_CATEGORY' ]
341341
342342 if category != '' :
343- metadata ['category ' ] = Category (category , self .settings )
343+ metadata ['categories ' ] = [ Category (category , self .settings )]
344344
345345 if 'date' not in metadata and self .settings .get ('DEFAULT_DATE' ):
346346 if self .settings ['DEFAULT_DATE' ] == 'fs' :
@@ -374,7 +374,8 @@ def generate_context(self):
374374
375375 for article in self .articles :
376376 # only main articles are listed in categories, not translations
377- self .categories [article .category ].append (article )
377+ for category in article .categories :
378+ self .categories [category ].append (article )
378379 # ignore blank authors as well as undefined
379380 if hasattr (article ,'author' ) and article .author .name != '' :
380381 self .authors [article .author ].append (article )
0 commit comments