Skip to content

Commit

Permalink
Add a "ty" (type) argument to Html.link
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris00 committed Nov 20, 2016
1 parent 09a634c commit b8c5c3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/cow_html.ml
Expand Up @@ -151,10 +151,11 @@ let aside = tag "aside"
let pre = tag "pre"
let main = tag "main"

let link ?cls ?id ?(attrs=[]) ?title ?rel ?media href =
let link ?cls ?id ?(attrs=[]) ?title ?media ?ty ?rel href =
let attrs = add_oattr "media" media attrs
|> add_oattr "title" title
|> add_oattr "rel" rel
|> add_oattr "title" title in
|> add_oattr "type" ty in
tag "link" empty ?cls ?id ~attrs:(("href", Uri.to_string href) :: attrs)

let base ?cls ?id ?(attrs=[]) ?target href =
Expand Down
3 changes: 2 additions & 1 deletion src/cow_html.mli
Expand Up @@ -377,7 +377,8 @@ val script: ?src:string -> ?typ:string -> ?charset:string -> t -> t
val head: node

val link: ?cls:string -> ?id:string -> ?attrs:(string * string) list ->
?title:string -> ?rel:string -> ?media:string -> Uri.t -> t
?title:string -> ?media:string ->
?ty:string -> ?rel:string -> Uri.t -> t
(** [link uri] returns a <link href="[uri]"> element to be put in the
<head>. *)

Expand Down

0 comments on commit b8c5c3b

Please sign in to comment.