Cleaned and fixed the org link broken export error
This commit is contained in:
@@ -25,7 +25,6 @@ def generate_search_index(org_dir, out_file):
|
||||
org_dir = Path(org_dir).expanduser()
|
||||
out_file = Path(out_file).expanduser()
|
||||
|
||||
# Recursively find all .org files (excluding Emacs lockfiles like .#foo.org)
|
||||
org_files = [
|
||||
f for f in org_dir.rglob("*.org")
|
||||
if not re.search(r"/\.#[^/]+\.org$", str(f))
|
||||
@@ -34,10 +33,12 @@ def generate_search_index(org_dir, out_file):
|
||||
index = []
|
||||
for file_path in org_files:
|
||||
org_id, title = get_org_id_and_title(file_path)
|
||||
filepath_relative = file_path.relative_to(org_dir).with_suffix('')
|
||||
|
||||
if org_id:
|
||||
index.append({
|
||||
"title": title,
|
||||
"url": f"/{file_path.stem}.html",
|
||||
"url": f"/{filepath_relative}.html",
|
||||
"id": org_id
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user