Restructuring of file hierachy and cleanup
This commit is contained in:
parent
5cce32eef3
commit
6ba78c6add
37 changed files with 793 additions and 132 deletions
6
cgbe.py
6
cgbe.py
|
@ -18,7 +18,7 @@ global_config = {
|
|||
},
|
||||
"generated_folder": "generated/",
|
||||
"generated": {
|
||||
"overview": "overview.html"
|
||||
"overview": "blog.html"
|
||||
}
|
||||
},
|
||||
"date_time": {
|
||||
|
@ -277,6 +277,7 @@ def collect_tags(metadata):
|
|||
|
||||
|
||||
def generate_blog_overview(overview_data, tag_data):
|
||||
opt["current_site"] = "blog"
|
||||
# generates general overview of the blogs on the page as well as overviews for each tag in use
|
||||
render_template(global_config["paths"]["templates"]["overview"], global_config["paths"]["generated"]["overview"],
|
||||
blog_data=overview_data, tag_occurences=tag_data, opt=opt)
|
||||
|
@ -284,6 +285,7 @@ def generate_blog_overview(overview_data, tag_data):
|
|||
|
||||
def generate_tag_overviews(tag_data):
|
||||
# generate overviews for each tag
|
||||
opt["current_site"] = ""
|
||||
if tag_data:
|
||||
for tag, occurences in tag_data.items():
|
||||
render_template("tag_overview.html", f"{global_config['paths']['generated_folder']}tags/{tag}.html", tag=tag,
|
||||
|
@ -292,6 +294,7 @@ def generate_tag_overviews(tag_data):
|
|||
|
||||
|
||||
def generate_blog_entries(blog_entry_data):
|
||||
opt["current_site"] = ""
|
||||
for entry in blog_entry_data:
|
||||
render_template("blog_entry.html", f"{global_config['paths']['generated_folder']}{entry.href}", entry=entry,
|
||||
overview_backlink=global_config["paths"]["generated"]["overview"], opt=opt)
|
||||
|
@ -378,7 +381,6 @@ For contact data provide argument "-c".
|
|||
|
||||
# TODO: remove the temporary opt assignment and find a more permanent solution
|
||||
opt["date"] = format_datetime(datetime.now())
|
||||
opt["current_site"] = "blog"
|
||||
|
||||
if True:
|
||||
# TODO: replace "if True" with a configurable variable which determines if tags are used
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue