not failing on missing 'categories' in .md file's
frontmatter header
This commit is contained in:
@@ -4,6 +4,7 @@ import shutil
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import markdown
|
import markdown
|
||||||
import frontmatter
|
import frontmatter
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from logger import logger
|
from logger import logger
|
||||||
from config import Config
|
from config import Config
|
||||||
@@ -114,7 +115,7 @@ class Site:
|
|||||||
|
|
||||||
def map_categories(self):
|
def map_categories(self):
|
||||||
for content_item in self.content_items:
|
for content_item in self.content_items:
|
||||||
for category in content_item.data.get("categories"):
|
for category in content_item.categories:
|
||||||
if not category == "default":
|
if not category == "default":
|
||||||
self.categories[category].append(content_item.slug)
|
self.categories[category].append(content_item.slug)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user