My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix arod to match live site: SVG icons, tag rendering, meta tags, tag sorting

- Update menu SVG icons to match live site (book/briefcase/pencil)
- Remove duplicate meta charset, viewport, and title tags from El.page
- Add hash-prefix spans in tag search links
- Fix tag sort order to be alphabetical

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+9 -13
+1 -1
arod/lib/arod_model.ml
··· 195 195 Entry.tags_of_ent (get_entries ()) ent 196 196 197 197 let concat_tags tags1 tags2 = 198 - tags1 @ (List.filter (fun t -> not (List.mem t tags1)) tags2) 198 + List.sort_uniq compare (tags1 @ tags2) 199 199 200 200 (** Count tags across all entries *) 201 201 let count_tags_for_ents entries =
+4 -7
arod/lib/arod_page.ml
··· 9 9 10 10 (** SVG icons for navigation *) 11 11 let svg_icon_paper = 12 - El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M3 2 L3 30 29 30 29 10 21 2 Z M21 2 L21 10 29 10 M7 14 L17 14 M7 18 L25 18 M7 22 L25 22 M7 26 L17 26" /></svg>|} 12 + El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M16 7 C16 7 9 1 2 6 L2 28 C9 23 16 28 16 28 16 28 23 23 30 28 L30 6 C23 1 16 7 16 7 Z M16 7 L16 28" /></svg>|} 13 13 14 14 let svg_icon_project = 15 - El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2 26 L30 26 30 8 2 8 Z M2 8 L10 8 12 4 20 4 22 8" /></svg>|} 15 + El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M30 8 L2 8 2 26 30 26 Z M20 8 C20 8 20 4 16 4 12 4 12 8 12 8 M8 26 L8 8 M24 26 L24 8" /></svg>|} 16 16 17 17 let svg_icon_note = 18 - El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M16 7 C16 7 2 11 2 22 L2 30 10 30 C10 30 22 30 30 22 M16 7 L30 22 M16 7 L30 4 30 22 M30 4 L16 4 10 10" /></svg>|} 18 + El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M27 15 L27 30 2 30 2 5 17 5 M30 6 L26 2 9 19 7 25 13 23 Z M22 6 L26 10 Z M9 19 L13 23 Z" /></svg>|} 19 19 20 20 let svg_icon_video = 21 21 El.unsafe_raw {|<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="18" height="18" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 13 L30 8 30 24 22 19 Z M2 8 L2 24 22 24 22 8 Z" /></svg>|} ··· 87 87 let page_title = if title = "" then cfg.site.name else title in 88 88 89 89 let head_els = [ 90 - El.title [El.txt page_title]; 91 - El.meta ~at:[At.charset "UTF-8"] (); 92 - El.meta ~at:[At.name "viewport"; At.content "width=device-width, initial-scale=1.0"] (); 93 90 El.meta ~at:[At.v "http-equiv" "X-UA-Compatible"; At.content "ie=edge"] (); 94 91 El.meta ~at:[At.name "description"; At.content description] (); 95 92 El.meta ~at:[At.v "property" "og:image"; At.content image] (); ··· 178 175 El.script ~at:[At.src "/assets/site.js"] [] 179 176 ] in 180 177 181 - El.page ~lang:"en" ~title:title ~more_head:(El.splice head_els) body_el 178 + El.page ~lang:"en" ~title:page_title ~more_head:(El.splice head_els) body_el 182 179 183 180 let bushel_graph () = 184 181 let title = "Bushel Link Graph" in
+4 -5
arod/lib/arod_view.ml
··· 218 218 Cmarkit.Inline.to_plain_text ~break_on_soft:false |> fun r -> 219 219 String.concat "\n" (List.map (String.concat "") r) in 220 220 Cmarkit_renderer.Context.string c 221 - (Printf.sprintf {|<a href="#" class="tag-search-link" data-search-tag="%s">#%s</a>|} 221 + (Printf.sprintf {|<a href="#" class="tag-search-link" data-search-tag="%s"><span class="hash-prefix">#</span>%s</a>|} 222 222 (html_escape_attr text) (html_escape_attr text)); 223 223 true 224 224 | Some (dest, _) when String.starts_with ~prefix:"###" dest -> ··· 238 238 Cmarkit.Inline.to_plain_text ~break_on_soft:false |> fun r -> 239 239 String.concat "\n" (List.map (String.concat "") r) in 240 240 Cmarkit_renderer.Context.string c 241 - (Printf.sprintf {|<a href="#" class="tag-search-link" data-search-tag="%s">#%s</a>|} 241 + (Printf.sprintf {|<a href="#" class="tag-search-link" data-search-tag="%s"><span class="hash-prefix">#</span>%s</a>|} 242 242 (html_escape_attr tag) (html_escape_attr text)); 243 243 true 244 244 | _ -> false ··· 784 784 785 785 let tags_meta ?extra ?link ?(tags=[]) ?date ?backlinks_content ent = 786 786 let tags = List.map Arod_model.Tags.of_string tags in 787 - let hash_span = El.span ~at:[At.class' "hash-prefix"] [El.txt "#"] in 788 787 let link_el = match link with 789 - | None -> El.a ~at:[At.href (Arod_model.Entry.site_url ent)] [hash_span] 790 - | Some l -> El.a ~at:[At.href l] [hash_span] 788 + | None -> El.a ~at:[At.href (Arod_model.Entry.site_url ent)] [El.txt "#"] 789 + | Some l -> El.a ~at:[At.href l] [El.txt "#"] 791 790 in 792 791 793 792 let date_str = ptime_date ~with_d:true