Compare commits

...

2 Commits

Author SHA1 Message Date
469160cae6 Update the path to the main index.php file. 2022-07-08 11:56:56 -04:00
73ab44d3f6 Remove menu_update function
This function is unnecessary as it is done automatically by simple_blog
itself.
2022-06-30 10:02:21 -04:00

View File

@ -42,13 +42,11 @@ def parse_file(article_path):
path_to_publish = os.path.join(path_to_publish, article_number + final_title.replace(' ', '_'))
print("Publishing to: {0}".format(path_to_publish))
os.makedirs(path_to_publish)
index_file = os.path.join(blog_config['general']['web_root'], 'common', 'index.php')
index_file = os.path.join(blog_config['general']['web_root'], 'common', 'php', 'index.php')
place_indexes(index_check_path, path_to_publish, index_file)
add_datestamp(article_path, os.path.join(path_to_publish, "article.md"))
article_imgs = find_local_links(article_path)
copy_all_imgs(article_imgs, path_to_publish)
menu_path = os.path.join(web_root, "common", "menu.php")
update_menu(menu_path, year, month)
tagging.tag_article(path_to_publish)
@ -127,27 +125,6 @@ def next_article_num(source_dir):
return next_num.zfill(2) + "_"
def update_menu(menu_path, year, month):
print(menu_path)
with open(menu_path, "r") as menu_source:
menu_text = menu_source.read()
soup = BeautifulSoup(menu_text, 'html.parser')
list_items = soup.find_all(id="blog")
last_post = soup.find_all(id="current_year")
# current_date = soup.find_all(attrs={"id": "date"})
item_count = 0
for items in last_post:
item_count += 1
print(item_count)
print(type(items))
print(items.attrs)
if "date=" in items:
print(items)
# print(list_items)
# print(last_post)
# print(current_date)
def choose_option(options, selecting):
count = 1
for option in options: