diff --git a/build.py b/build.py index 428360b..017aab6 100644 --- a/build.py +++ b/build.py @@ -91,16 +91,24 @@ def build_page(md_path, html_path, title): f.write(TEMPLATE.format(title=title, content=html_content)) # Улучшенная навигация с "хлебными крошками" -def build_breadcrumbs(path): - """Создает навигационную цепочку""" - crumbs = [ - '') +def build_breadcrumbs(current_path): + """Создает навигационную цепочку (хлебные крошки)""" + crumbs = ['') return ''.join(crumbs) # ------------------------------------------------------------------------ def main(): @@ -115,6 +123,10 @@ def main(): # 2. Страница новостей news_files = sorted(Path('content/news').glob('*.md'), reverse=True) news_links = "".join([f'
  • {f.stem.replace("-", " ").title()}
  • ' for f in news_files]) + # Добавляем хлебные крошки к контенту + breadcrumbs = build_breadcrumbs('/news.html') + news_content = breadcrumbs + "

    Последние новости

    " + with open('public/news.html', 'w', encoding='utf-8') as f: f.write(TEMPLATE.format(title="Новости", content=f"

    Последние новости

    ")) for md_file in news_files: