Add pinned files and filter hiding

This commit is contained in:
2026-02-17 13:54:53 -05:00
parent ca3fbe4149
commit b737200b21
3 changed files with 263 additions and 47 deletions

View File

@ -656,12 +656,17 @@ def build_index_page(
created_key_attr = "" if created_key is None else str(created_key)
modified_ts = str(int(f.mtime))
pin_icon = "\U0001F4CC " if f.pinned else ""
display_title = f"{pin_icon}TODAY" if f.pinned else safe_title
pinned_attr = "server" if f.pinned else ""
nav_items.append(
f"<a class='file-link {active}' data-search='{searchable}' "
f"data-backlinks='{backlinks_count}' data-created-ts='{created_key_attr}' "
f"data-modified-ts='{modified_ts}' href='{safe_href}'>"
f"<span class='file-title' title='{full_title}'>{pin_icon}{safe_title}</span>"
f"data-modified-ts='{modified_ts}' data-pinned='{pinned_attr}' "
f"data-file-path='{full_path}' href='{safe_href}'>"
f"<span class='file-title' title='{full_title}'>{display_title}</span>"
f"<span class='file-path' title='{full_path}'>{safe_path}</span>"
f"<button class='pin-toggle' type='button' title='Pin/unpin this file' "
f"aria-label='Pin or unpin this file'>&#x1F4CC;</button>"
"</a>"
)