Remove menu_update function
This function is unnecessary as it is done automatically by simple_blog itself.
This commit is contained in:
parent
132fa394d4
commit
73ab44d3f6
@ -47,8 +47,6 @@ def parse_file(article_path):
|
|||||||
add_datestamp(article_path, os.path.join(path_to_publish, "article.md"))
|
add_datestamp(article_path, os.path.join(path_to_publish, "article.md"))
|
||||||
article_imgs = find_local_links(article_path)
|
article_imgs = find_local_links(article_path)
|
||||||
copy_all_imgs(article_imgs, path_to_publish)
|
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)
|
tagging.tag_article(path_to_publish)
|
||||||
|
|
||||||
|
|
||||||
@ -127,27 +125,6 @@ def next_article_num(source_dir):
|
|||||||
return next_num.zfill(2) + "_"
|
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):
|
def choose_option(options, selecting):
|
||||||
count = 1
|
count = 1
|
||||||
for option in options:
|
for option in options:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user