add categories to post
This commit is contained in:
parent
162ecce865
commit
acb8ea4d08
@ -5,6 +5,7 @@ draft: false
|
||||
summary: "{{ frontmatter.summary }}"
|
||||
author: "{{ frontmatter.author }}"
|
||||
original_link: "{{ frontmatter.original_link }}"
|
||||
categories: ["network, {{ frontmatter.feed_name}}"]
|
||||
|
||||
---
|
||||
|
||||
|
@ -66,7 +66,8 @@ def create_frontmatter(entry):
|
||||
'date': published.format(),
|
||||
'summary': '',
|
||||
'author': author,
|
||||
'original_link': entry.link
|
||||
'original_link': entry.link,
|
||||
'feed_name': entry['feed_name']
|
||||
}
|
||||
|
||||
return frontmatter
|
||||
@ -172,8 +173,8 @@ env = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader(os.path.curdir)
|
||||
)
|
||||
|
||||
#output_dir = os.environ.get('OUTPUT_DIR', '/home/r/Programming/lumbung.space/lumbung.space-web/content/posts/')
|
||||
output_dir = os.environ.get('OUTPUT_DIR', 'network/')
|
||||
output_dir = os.environ.get('OUTPUT_DIR', '/home/r/Programming/lumbung.space/lumbung.space-web/content/posts/')
|
||||
#output_dir = os.environ.get('OUTPUT_DIR', 'network/')
|
||||
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
@ -198,6 +199,7 @@ for feed_url in feed_urls:
|
||||
for entry in data.entries:
|
||||
# if 'tags' in entry:
|
||||
# print(entry.title, entry.tags)
|
||||
entry['feed_name'] = feed_name
|
||||
|
||||
post_name = slugify(entry.title)
|
||||
post_dir = os.path.join(output_dir, feed_name, post_name)
|
||||
|
Loading…
Reference in New Issue
Block a user