bice vremena za blog, ja moram stranicu za donacije da pravim
This commit is contained in:
parent
56917d46a3
commit
9f5d011ad5
30
atom_gen.py
30
atom_gen.py
@ -11,20 +11,20 @@ import os
|
||||
|
||||
blogs_dir = os.fsencode("blog")
|
||||
|
||||
def blogposts_list_gen():
|
||||
output_list = []
|
||||
for file in os.listdir(blogs_dir):
|
||||
filename = os.fsdecode(file)
|
||||
if filename.endswith(".md"):
|
||||
full_path = "blog/" + filename
|
||||
|
||||
author = subprocess.run("lowdown -X author " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
title = subprocess.run("lowdown -X title " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
time = subprocess.run("lowdown -X time " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
content_html = subprocess.run("lowdown " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
|
||||
output_list.append([author, title, time, content_html, full_path])
|
||||
return output_list
|
||||
#def blogposts_list_gen():
|
||||
# output_list = []
|
||||
# for file in os.listdir(blogs_dir):
|
||||
# filename = os.fsdecode(file)
|
||||
# if filename.endswith(".md"):
|
||||
# full_path = "blog/" + filename
|
||||
#
|
||||
# author = subprocess.run("lowdown -X author " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
# title = subprocess.run("lowdown -X title " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
# time = subprocess.run("lowdown -X time " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
# content_html = subprocess.run("lowdown " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
#
|
||||
# output_list.append([author, title, time, content_html, full_path])
|
||||
# return output_list
|
||||
|
||||
def events_list_gen():
|
||||
output_list = []
|
||||
@ -69,5 +69,3 @@ def feedgen(blogs, events):
|
||||
|
||||
fg_blog.atom_file('site/atom_blog.xml')
|
||||
fg_events.atom_file('site/atom_events.xml')
|
||||
|
||||
feedgen(blogposts_list_gen(), events_list_gen())
|
||||
|
Loading…
Reference in New Issue
Block a user