bloggy 0.1.40__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bloggy/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.40"
1
+ __version__ = "0.2.3"
2
2
 
3
3
  from .core import app, rt, get_root_folder, get_blog_title
4
4
 
bloggy/build.py CHANGED
@@ -20,7 +20,7 @@ from .core import (
20
20
  from .config import get_config, reload_config
21
21
 
22
22
 
23
- def generate_static_html(title, body_content, blog_title):
23
+ def generate_static_html(title, body_content, blog_title, favicon_href):
24
24
  """Generate complete static HTML page"""
25
25
 
26
26
  # Static CSS (inline critical styles)
@@ -56,7 +56,7 @@ def generate_static_html(title, body_content, blog_title):
56
56
  margin: 2rem 0;
57
57
  border: 1px solid rgb(226 232 240);
58
58
  border-radius: 0.5rem;
59
- overflow: hidden;
59
+ overflow: visible;
60
60
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
61
61
  }
62
62
  .dark .tabs-container {
@@ -115,6 +115,7 @@ def generate_static_html(title, body_content, blog_title):
115
115
  .tabs-content {
116
116
  background: white;
117
117
  position: relative;
118
+ overflow: visible;
118
119
  }
119
120
  .dark .tabs-content {
120
121
  background: rgb(2 6 23);
@@ -130,6 +131,7 @@ def generate_static_html(title, body_content, blog_title):
130
131
  opacity: 0;
131
132
  visibility: hidden;
132
133
  pointer-events: none;
134
+ overflow: visible;
133
135
  }
134
136
  .tab-panel.active {
135
137
  position: relative;
@@ -308,6 +310,7 @@ def generate_static_html(title, body_content, blog_title):
308
310
  <script src="https://unpkg.com/hyperscript.org@0.9.12"></script>
309
311
 
310
312
  <!-- Static assets -->
313
+ <link rel="icon" href="{favicon_href}">
311
314
  <link rel="stylesheet" href="/static/sidenote.css">
312
315
 
313
316
  {static_css}
@@ -390,7 +393,7 @@ def build_post_tree_static(folder, root_folder):
390
393
  return items
391
394
 
392
395
 
393
- def static_layout(content_html, blog_title, page_title, nav_tree, toc_items=None, current_path=None):
396
+ def static_layout(content_html, blog_title, page_title, nav_tree, favicon_href, toc_items=None, current_path=None):
394
397
  """Generate complete static page layout"""
395
398
 
396
399
  # Theme toggle button
@@ -474,7 +477,7 @@ def static_layout(content_html, blog_title, page_title, nav_tree, toc_items=None
474
477
  </div>
475
478
  '''
476
479
 
477
- return generate_static_html(page_title, body, blog_title)
480
+ return generate_static_html(page_title, body, blog_title, favicon_href)
478
481
 
479
482
 
480
483
  def build_static_site(input_dir=None, output_dir=None):
@@ -514,6 +517,8 @@ def build_static_site(input_dir=None, output_dir=None):
514
517
 
515
518
  # Build navigation tree with static .html links
516
519
  nav_tree = build_post_tree_static(root_folder, root_folder)
520
+ root_icon = root_folder / "static" / "icon.png"
521
+ favicon_href = "/static/icon.png" if root_icon.exists() else "/static/favicon.png"
517
522
 
518
523
  # Find all markdown files (only in the specified root folder, not parent directories)
519
524
  md_files = []
@@ -552,6 +557,7 @@ def build_static_site(input_dir=None, output_dir=None):
552
557
  blog_title=blog_title,
553
558
  page_title=f"{post_title} - {blog_title}",
554
559
  nav_tree=nav_tree,
560
+ favicon_href=favicon_href,
555
561
  toc_items=toc_items,
556
562
  current_path=str(relative_path.with_suffix(''))
557
563
  )
@@ -574,6 +580,10 @@ def build_static_site(input_dir=None, output_dir=None):
574
580
  static_dst = output_dir / 'static'
575
581
  print(f"\nCopying static assets...")
576
582
  shutil.copytree(static_src, static_dst, dirs_exist_ok=True)
583
+ if root_icon.exists():
584
+ static_dst = output_dir / 'static'
585
+ static_dst.mkdir(parents=True, exist_ok=True)
586
+ shutil.copy2(root_icon, static_dst / "icon.png")
577
587
 
578
588
  # Generate index.html if it doesn't exist
579
589
  index_path = output_dir / 'index.html'
@@ -593,6 +603,7 @@ def build_static_site(input_dir=None, output_dir=None):
593
603
  blog_title=blog_title,
594
604
  page_title=f"Home - {blog_title}",
595
605
  nav_tree=nav_tree,
606
+ favicon_href=favicon_href,
596
607
  toc_items=None
597
608
  )
598
609
 
bloggy/config.py CHANGED
@@ -112,6 +112,14 @@ class BloggyConfig:
112
112
  user = self.get('username', 'BLOGGY_USER', None)
113
113
  pwd = self.get('password', 'BLOGGY_PASSWORD', None)
114
114
  return user, pwd
115
+
116
+ def get_sidebars_open(self) -> bool:
117
+ """Get whether sidebars should be open by default."""
118
+ value = self.get('sidebars_open', 'BLOGGY_SIDEBARS_OPEN', True)
119
+ # Handle string values from environment variables
120
+ if isinstance(value, str):
121
+ return value.lower() in ('true', '1', 'yes', 'on')
122
+ return bool(value)
115
123
 
116
124
 
117
125