[OCaml] Mobile-friendly clone of cgit.
Add index link on repo pages to return to homepage
Shows an 'index' link above the page header on all repo pages, linking back to the root. Not displayed on the root page itself.
Changed files
lib/static/styles.css
@@ -16,6 +16,16 @@
16
16
padding: 0.5em 0;
17
17
}
18
18
19
Added:
#index-link {
20
Added:
color: skyblue;
21
Added:
text-decoration: none;
22
Added:
font-size: 0.9em;
23
Added:
}
24
Added:
25
Added:
#index-link:hover {
26
Added:
text-decoration: underline;
27
Added:
}
28
Added:
19
29
#page-header .site-logo {
20
30
width: 2.5em;
21
31
height: 2.5em;
lib/views.ml
@@ -69,6 +69,10 @@
69
69
let open HTML in
70
70
body []
71
71
[
72
Added:
(match bd.repo with
73
Added:
| None -> null []
74
Added:
| Some _ ->
75
Added:
Routes.link_to Root ~other_attrs:[ id "index-link" ] (txt "index"));
72
76
page_header bd.title bd.subtitle;
73
77
(match bd.repo with
74
78
| None -> HTML.null []