Changeset 50 in code


Ignore:
Timestamp:
Oct 19, 2023, 1:21:22 AM (18 months ago)
Author:
yakumo.izuru
Message:

Prettify HTML output and add a hardcoded favicon path (soon to be configurable)

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/html.ml

    r48 r50  
    1414        let footer = to_string "HTM-footer" kv in
    1515        let style = match to_string "HTM-style" kv with
    16                 | Some s -> Printf.sprintf "<style>%s</style>" s | None -> "" in
     16                | Some s -> Printf.sprintf "<style>%s</style>\n" s | None -> "" in
    1717        { templates = { header; footer}; style }
    1818
     
    3232        in
    3333        let footer = match htm.templates.footer with None -> "" | Some x -> replace x in
    34         Printf.sprintf "<!DOCTYPE HTML PUBLIC \"//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>%s%s</title>\n%s\n%s\
    35         <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\"></head><body>\n%s%s%s</body></html>"
     34        Printf.sprintf "<!DOCTYPE HTML PUBLIC \"//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<link rel=\"icon\" href=\"/favicon.png\">\n<title>%s%s</title>\n%s\n%s\
     35        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n</head>\n<body>\n%s%s%s</body>\n</html>"
    3636        text_title (if site_title <> "" then (" • " ^ site_title) else "")
    3737        htm.style
Note: See TracChangeset for help on using the changeset viewer.