@@ -27,6 +27,10 @@ let url_of_nav_item = function
27
27
28
28
let nav_items = [ Learn; Platform; Packages; Community; Consortium; News; Playground ]
29
29
30
+ let git_branch = try Sys.getenv "GIT_BRANCH" with Not_found -> failwith "Environment variable GIT_BRANCH is not set"
31
+ let git_commit = try Sys.getenv "GIT_COMMIT" with Not_found -> failwith "Environment variable GIT_COMMIT is not set"
32
+ let git_short_commit = if String.length git_commit > 6 then String.sub git_commit 0 7 else git_commit
33
+
30
34
let menu_link
31
35
~(active: bool)
32
36
~href
@@ -50,8 +54,27 @@ let search_dropdown () =
50
54
</a>
51
55
in
52
56
<header
53
- class="fixed top-0 z-50 w-full h-20 flex items-center "
54
- x-data="{ open: false }">
57
+ class="fixed top-0 z-50 w-full h-20 flex items-center flex-wrap"
58
+ x-data="{ open: false }">
59
+ <% if git_branch <> "main" then (%>
60
+ <div id="alert-border-2" class="bg-primary_25 border-secondary border-t-4 bottom-0 dark:bg-dark-card fixed flex items-center justify-center p-4 text-center tracking-wide w-full" role="alert">
61
+ <svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
62
+ <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
63
+ </svg>
64
+ <div class="ms-3 text-sm font-medium">
65
+ You are viewing the <a class="font-semibold underline hover:no-underline" href="https://github.com/coq/rocq-prover.org/tree/<%s git_branch %>"><%s git_branch %> branch</a> of the website @
66
+ <a class="font-semibold underline hover:no-underline" href="https://github.com/coq/rocq-prover.org/commit/<%s git_commit %>"><%s git_short_commit %></a>,
67
+ not the <a class="font-semibold underline hover:no-underline" href="https://rocq-prover.org">live version</a>.
68
+ </div>
69
+ <button type="button" class="ms-3 -mx-1.5 -my-1.5 bg-red-50 text-red-500 rounded-lg focus:ring-2 focus:ring-red-400 p-1.5 hover:bg-red-200 inline-flex items-center justify-center h-8 w-8 dark:bg-gray-800 dark:text-red-400 dark:hover:bg-gray-700" data-dismiss-target="#alert-border-2" aria-label="Close">
70
+ <span class="sr-only">Dismiss</span>
71
+ <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
72
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
73
+ </svg>
74
+ </button>
75
+ </div>
76
+ <script src="https://unpkg.com/
[email protected] /dist/flowbite.js"></script>
77
+ <% ); %>
55
78
<nav class="bg-background container-fluid dark:bg-dark-background_navigation flex gap-5 h-20 header items-center justify-between rounded-b-lg shadow-sm wide xl:gap-8">
56
79
<ul class="order-0 space space-x-5 xl:space-x-8 items-center flex text-content font-medium dark:text-title dark:text-opacity-60 dark:font-semibold">
57
80
<li style="width:170px">
102
125
<nav class="z-50 h-full fixed right-0 top-0 max-w-full w-96 bg-background dark:bg-dark-background shadow-lg" x-show="open" x-cloak
103
126
@click.away="open = false" x-transition:enter="transition duration-200 ease-out"
104
127
x-transition:enter-start="translate-x-full" x-transition:leave="transition duration-100 ease-in"
105
- x-transition:leave-end="translate-x-full">
128
+ x-transition:leave-end="translate-x-full">
106
129
<ul class="text-content p-6 font-semibold">
107
130
<li class="flex justify-between items-center">
108
131
<a href="<%s Url.index %>">
109
132
<img src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-blue_orange.svg" %>" width="132" alt="Rocq logo" class="dark:hidden">
110
133
<img src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" width="132" alt="Rocq logo" class="hidden dark:inline">
111
134
</a>
112
-
113
135
<div class=""
114
136
x-on:click="open = false">
115
137
<button aria-label="close" class="text-content dark:text-dark-title">
127
149
%>
128
150
</form>
129
151
</li>
130
-
131
152
<% nav_items |> List.iter (fun (n : nav_item) -> %>
132
153
<li><%s! menu_link ~_class:"block" ~active:(active_top_nav_item=Some n) ~href:(url_of_nav_item n) ~title:(string_of_nav_item n) () %></li>
133
154
<% ); %>
0 commit comments