now this should work
This commit is contained in:
@@ -21,6 +21,8 @@ meta_path = os.path.expanduser(config.meta_dir)
|
|||||||
# Initiate meta lists
|
# Initiate meta lists
|
||||||
posts = []
|
posts = []
|
||||||
posts_prop_index = {}
|
posts_prop_index = {}
|
||||||
|
for prop_dict in config.index_props:
|
||||||
|
posts_prop_index[prop_dict["property"]] = {}
|
||||||
|
|
||||||
os.chdir(md_path)
|
os.chdir(md_path)
|
||||||
|
|
||||||
@@ -77,7 +79,6 @@ for dirname, subdirlist, mdlist in os.walk('.'):
|
|||||||
# Extract index properties
|
# Extract index properties
|
||||||
for prop_dict in config.index_props:
|
for prop_dict in config.index_props:
|
||||||
prop = prop_dict["property"]
|
prop = prop_dict["property"]
|
||||||
posts_prop_index[prop] = {}
|
|
||||||
post[prop] = meta.get(prop, None)
|
post[prop] = meta.get(prop, None)
|
||||||
if prop_dict.get("list", False) and post[prop]:
|
if prop_dict.get("list", False) and post[prop]:
|
||||||
post[prop] = post[prop].split(',')
|
post[prop] = post[prop].split(',')
|
||||||
@@ -87,7 +88,6 @@ for dirname, subdirlist, mdlist in os.walk('.'):
|
|||||||
posts_prop_index[prop][slug]["posts"].append(post)
|
posts_prop_index[prop][slug]["posts"].append(post)
|
||||||
else:
|
else:
|
||||||
posts_prop_index[prop][slug] = {"name": item, "posts": [post]}
|
posts_prop_index[prop][slug] = {"name": item, "posts": [post]}
|
||||||
print(item)
|
|
||||||
else:
|
else:
|
||||||
slug = slugify(post[prop])
|
slug = slugify(post[prop])
|
||||||
if slug in posts_prop_index[prop]:
|
if slug in posts_prop_index[prop]:
|
||||||
|
|||||||
Reference in New Issue
Block a user