Skip to content

Commit

Permalink
sync changes:
Browse files Browse the repository at this point in the history
- M  scripts/build.py

- M  site/categories/index.html

- M  site/index.html
  • Loading branch information
elimelt committed Jan 12, 2025
1 parent 21afe6c commit 57a22de
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
10 changes: 5 additions & 5 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _generate_special_pages(self) -> None:

def _render_categories_index(self) -> str:
"""Render the categories index page"""
content = "<h2>Categories</h2>\n<ul>"
content = "<ul>"
for category, pages in sorted(self.categories.items()):
category_url = f"/categories/{quote(category.lower())}.html"
content += f'\n<li><a href="{category_url}">{category}</a> ({len(pages)} pages)</li>'
Expand All @@ -236,7 +236,7 @@ def _render_categories_index(self) -> str:

def _render_tags_index(self) -> str:
"""Render the tags index page"""
content = "<h2>Tags</h2>\n<ul>"
content = "<ul>"
for tag, pages in sorted(self.tags.items()):
tag_url = f"/tags/{quote(tag.lower())}.html"
content += f'\n<li><a href="{tag_url}">{tag}</a> ({len(pages)} pages)</li>'
Expand Down Expand Up @@ -365,7 +365,7 @@ def _generate_main_index(self) -> None:
] # Show 10 most recent

# Generate recent posts section
recent_content = "<h2>Recent Notes</h2>\n<ul class='recent-posts'>"
recent_content = "<h2>Recent</h2>\n<ul class='recent-posts'>"
for page in recent_pages:
page_url = f"/{page.path.with_suffix('.html')}"
date_str = page.modified_date.strftime("%Y-%m-%d")
Expand All @@ -392,7 +392,7 @@ def _generate_main_index(self) -> None:
tag_counts = {tag: len(pages) for tag, pages in self.tags.items()}
popular_tags = sorted(tag_counts.items(), key=lambda x: (-x[1], x[0]))[:20]

tags_content = "<h2>Popular Tags</h2>\n<div class='tags-cloud'>"
tags_content = "<h2>Featured Tags</h2>\n<div class='tags-cloud'>"
for tag, count in popular_tags:
tag_url = f"/tags/{quote(tag.lower())}.html"
tags_content += f'<a href="{tag_url}" class="tag-{min(count, 5)}">{tag} <span>({count})</span></a>'
Expand Down Expand Up @@ -434,7 +434,7 @@ def _generate_main_index(self) -> None:

# Create the index page
index_page = Page(
title="My Notes",
title="",
path=Path("index.md"),
content=content,
modified_date=datetime.now(),
Expand Down
3 changes: 1 addition & 2 deletions site/categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ <h1>Categories</h1>

</div>
<div class="content">
<h2>Categories</h2>
<ul>
<ul>
<li><a href="/categories/algorithm%20analysis.html">Algorithm Analysis</a> (2 pages)</li>
<li><a href="/categories/computer%20science.html">Computer Science</a> (1 pages)</li>
<li><a href="/categories/database%20design.html">Database Design</a> (1 pages)</li>
Expand Down
8 changes: 4 additions & 4 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Notes</title>
<title></title>
<meta name="description" content="So so many notes">
<style>
:root {
Expand Down Expand Up @@ -180,7 +180,7 @@
<div class="breadcrumbs">
<a href="/index.html">Home</a>
</div>
<h1>My Notes</h1>
<h1></h1>
<div class="meta">
<span>Last modified: 2025-01-12</span>

Expand All @@ -203,7 +203,7 @@ <h1>My Notes</h1>
</div>
<div class="landing-grid">
<div class="recent-section">
<h2>Recent Notes</h2>
<h2>Recent</h2>
<ul class='recent-posts'>
<li>
<a href="/systems-research/strong-inference.html">Strong Inference</a>
Expand Down Expand Up @@ -309,7 +309,7 @@ <h2>Categories</h2>
</li></ul>
</div>
<div class="tags-section">
<h2>Popular Tags</h2>
<h2>Featured Tags</h2>
<div class='tags-cloud'><a href="/tags/paper.html" class="tag-4">paper <span>(4)</span></a><a href="/tags/review.html" class="tag-4">review <span>(4)</span></a><a href="/tags/meta.html" class="tag-3">meta <span>(3)</span></a><a href="/tags/optimization.html" class="tag-3">optimization <span>(3)</span></a><a href="/tags/research.html" class="tag-3">research <span>(3)</span></a><a href="/tags/algorithms.html" class="tag-2">algorithms <span>(2)</span></a><a href="/tags/breadth-first%20search.html" class="tag-2">breadth-first search <span>(2)</span></a><a href="/tags/data%20structures.html" class="tag-2">data structures <span>(2)</span></a><a href="/tags/graph%20properties.html" class="tag-2">graph properties <span>(2)</span></a><a href="/tags/graph%20theory.html" class="tag-2">graph theory <span>(2)</span></a><a href="/tags/proof%20techniques.html" class="tag-2">proof techniques <span>(2)</span></a><a href="/tags/vertex%20cover.html" class="tag-2">vertex cover <span>(2)</span></a><a href="/tags/acyclic%20graphs.html" class="tag-1">acyclic graphs <span>(1)</span></a><a href="/tags/algorithm.html" class="tag-1">algorithm <span>(1)</span></a><a href="/tags/algorithm-analysis.html" class="tag-1">algorithm-analysis <span>(1)</span></a><a href="/tags/approximation.html" class="tag-1">approximation <span>(1)</span></a><a href="/tags/asymptotic%20notation.html" class="tag-1">asymptotic notation <span>(1)</span></a><a href="/tags/batch%20processing.html" class="tag-1">batch processing <span>(1)</span></a><a href="/tags/bipartite%20graphs.html" class="tag-1">bipartite graphs <span>(1)</span></a><a href="/tags/bipartite%20matching.html" class="tag-1">bipartite matching <span>(1)</span></a></div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions site/scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _generate_special_pages(self) -> None:

def _render_categories_index(self) -> str:
"""Render the categories index page"""
content = "<h2>Categories</h2>\n<ul>"
content = "<ul>"
for category, pages in sorted(self.categories.items()):
category_url = f"/categories/{quote(category.lower())}.html"
content += f'\n<li><a href="{category_url}">{category}</a> ({len(pages)} pages)</li>'
Expand All @@ -236,7 +236,7 @@ def _render_categories_index(self) -> str:

def _render_tags_index(self) -> str:
"""Render the tags index page"""
content = "<h2>Tags</h2>\n<ul>"
content = "<ul>"
for tag, pages in sorted(self.tags.items()):
tag_url = f"/tags/{quote(tag.lower())}.html"
content += f'\n<li><a href="{tag_url}">{tag}</a> ({len(pages)} pages)</li>'
Expand Down Expand Up @@ -365,7 +365,7 @@ def _generate_main_index(self) -> None:
] # Show 10 most recent

# Generate recent posts section
recent_content = "<h2>Recent Notes</h2>\n<ul class='recent-posts'>"
recent_content = "<h2>Recent</h2>\n<ul class='recent-posts'>"
for page in recent_pages:
page_url = f"/{page.path.with_suffix('.html')}"
date_str = page.modified_date.strftime("%Y-%m-%d")
Expand All @@ -392,7 +392,7 @@ def _generate_main_index(self) -> None:
tag_counts = {tag: len(pages) for tag, pages in self.tags.items()}
popular_tags = sorted(tag_counts.items(), key=lambda x: (-x[1], x[0]))[:20]

tags_content = "<h2>Popular Tags</h2>\n<div class='tags-cloud'>"
tags_content = "<h2>Featured Tags</h2>\n<div class='tags-cloud'>"
for tag, count in popular_tags:
tag_url = f"/tags/{quote(tag.lower())}.html"
tags_content += f'<a href="{tag_url}" class="tag-{min(count, 5)}">{tag} <span>({count})</span></a>'
Expand Down Expand Up @@ -434,7 +434,7 @@ def _generate_main_index(self) -> None:

# Create the index page
index_page = Page(
title="My Notes",
title="",
path=Path("index.md"),
content=content,
modified_date=datetime.now(),
Expand Down
3 changes: 1 addition & 2 deletions site/tags/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ <h1>Tags</h1>

</div>
<div class="content">
<h2>Tags</h2>
<ul>
<ul>
<li><a href="/tags/acyclic%20graphs.html">acyclic graphs</a> (1 pages)</li>
<li><a href="/tags/algorithm.html">algorithm</a> (1 pages)</li>
<li><a href="/tags/algorithm-analysis.html">algorithm-analysis</a> (1 pages)</li>
Expand Down

0 comments on commit 57a22de

Please sign in to comment.