Omit bullet in empty title conversions, tidy html.ml
git-svn-id: file:///srv/svn/repo/kosuzu/trunk@18 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
13
cli/html.ml
13
cli/html.ml
@@ -7,12 +7,11 @@ let default_opts = { templates = empty_templates }
|
|||||||
|
|
||||||
let init kv =
|
let init kv =
|
||||||
let open Logarion in
|
let open Logarion in
|
||||||
let header = match Store.KV.find "HTM-header" kv with
|
let to_string key kv = match Store.KV.find key kv with
|
||||||
| fname -> Some (File_store.to_string fname)
|
|
||||||
| exception Not_found -> None in
|
|
||||||
let footer = match Store.KV.find "HTM-footer" kv with
|
|
||||||
| fname -> Some (File_store.to_string fname)
|
| fname -> Some (File_store.to_string fname)
|
||||||
| exception Not_found -> None in
|
| exception Not_found -> None in
|
||||||
|
let header = to_string "HTM-header" kv in
|
||||||
|
let footer = to_string "HTM-footer" kv in
|
||||||
{ templates = { header; footer} }
|
{ templates = { header; footer} }
|
||||||
|
|
||||||
let wrap c htm text_title body =
|
let wrap c htm text_title body =
|
||||||
@@ -28,11 +27,13 @@ let wrap c htm text_title body =
|
|||||||
"</a><nav><a href='feed.atom' id='feed'>feed</a></nav></header>"
|
"</a><nav><a href='feed.atom' id='feed'>feed</a></nav></header>"
|
||||||
in
|
in
|
||||||
let footer = match htm.templates.footer with None -> "" | Some x -> replace x in
|
let footer = match htm.templates.footer with None -> "" | Some x -> replace x in
|
||||||
"<!DOCTYPE HTML><html><head><title>" ^ text_title ^ " • " ^ site_title ^ "</title>\n\
|
Printf.sprintf "<!DOCTYPE HTML><html><head><title>%s%s</title>\n\
|
||||||
<link rel='stylesheet' href='main.css'>\
|
<link rel='stylesheet' href='main.css'>\
|
||||||
<link rel='alternate' href='feed.atom' type='application/atom+xml'>\
|
<link rel='alternate' href='feed.atom' type='application/atom+xml'>\
|
||||||
<meta charset='utf-8'/><meta name='viewport' content='width=device-width, initial-scale=1.0'>\
|
<meta charset='utf-8'/><meta name='viewport' content='width=device-width, initial-scale=1.0'>\
|
||||||
</head><body>\n" ^ header ^ body ^ footer ^ "</body></html>"
|
</head><body>\n%s%s%s</body></html>"
|
||||||
|
text_title (if site_title <> "" then (" • " ^ site_title) else "")
|
||||||
|
header body footer
|
||||||
|
|
||||||
let topic_link root topic =
|
let topic_link root topic =
|
||||||
let replaced_space = String.map (function ' '->'+' | x->x) in
|
let replaced_space = String.map (function ' '->'+' | x->x) in
|
||||||
|
|||||||
Reference in New Issue
Block a user