Changeset 15 in code for trunk/cli/gemini.ml


Ignore:
Timestamp:
Sep 24, 2022, 8:01:37 PM (3 years ago)
Author:
fox
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/gemini.ml

    r3 r15  
    7272  List.fold_left (fun a x -> a ^ list_item x x) "" (List.rev topic_roots)
    7373
    74 let topic_main_index title topic_roots metas =
    75         "# " ^ title ^ "\n\n"
     74let topic_main_index r title topic_roots metas =
     75  "# " ^ title ^ "\n\n"
    7676  ^ (if topic_roots <> [] then ("## Main topics\n\n" ^ fold_topic_roots topic_roots) else "")
    7777  ^ "\n## Latest\n\n" ^ to_dated_links ~limit:10 metas
    78   ^ "\n=> index.date.gmi More by date\n"
     78  ^ "\n=> index.date.gmi More by date\n\n"
     79  ^ let peers = Logarion.Store.KV.find "Peers" r.Conversion.kv in
     80    if peers = "" then "" else
     81    List.fold_left (fun a s -> Printf.sprintf "%s=> %s\n" a s) "## Peers\n\n"
     82      (Str.split (Str.regexp ";\n") peers)
    7983
    8084let topic_sub_index title topic_map topic_root metas =
     
    8993
    9094        if index_name <> "" then
    91                 file index_name (topic_main_index title r.topic_roots r.texts);
     95                file index_name (topic_main_index r title r.topic_roots r.texts);
    9296
    9397        file "index.date.gmi" (date_index title r.texts);
Note: See TracChangeset for help on using the changeset viewer.