List peers (from index.pck) in exported htm and gmi index

git-svn-id: file:///srv/svn/repo/kosuzu/trunk@15 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
fox
2022-09-24 20:01:37 +00:00
parent 4f42df7037
commit ef29c97a92
5 changed files with 23 additions and 12 deletions

View File

@@ -71,11 +71,15 @@ let fold_topic_roots topic_roots =
let list_item root t = topic_link root t in
List.fold_left (fun a x -> a ^ list_item x x) "" (List.rev topic_roots)
let topic_main_index title topic_roots metas =
"# " ^ title ^ "\n\n"
let topic_main_index r title topic_roots metas =
"# " ^ title ^ "\n\n"
^ (if topic_roots <> [] then ("## Main topics\n\n" ^ fold_topic_roots topic_roots) else "")
^ "\n## Latest\n\n" ^ to_dated_links ~limit:10 metas
^ "\n=> index.date.gmi More by date\n"
^ "\n=> index.date.gmi More by date\n\n"
^ let peers = Logarion.Store.KV.find "Peers" r.Conversion.kv in
if peers = "" then "" else
List.fold_left (fun a s -> Printf.sprintf "%s=> %s\n" a s) "## Peers\n\n"
(Str.split (Str.regexp ";\n") peers)
let topic_sub_index title topic_map topic_root metas =
"# " ^ title ^ "\n\n"
@@ -88,7 +92,7 @@ let indices r =
let title = try Store.KV.find "Title" r.Conversion.kv with Not_found -> "" in
if index_name <> "" then
file index_name (topic_main_index title r.topic_roots r.texts);
file index_name (topic_main_index r title r.topic_roots r.texts);
file "index.date.gmi" (date_index title r.texts);