@@ -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
@@ -51,7 +55,7 @@ let search_dropdown () =
51
55
in
52
56
<header
53
57
class="fixed top-0 z-50 w-full h-20 flex items-center "
54
- x-data="{ open: false }">
58
+ x-data="{ open: false }">
55
59
<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
60
<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
61
<li style="width:170px">
102
106
<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
107
@click.away="open = false" x-transition:enter="transition duration-200 ease-out"
104
108
x-transition:enter-start="translate-x-full" x-transition:leave="transition duration-100 ease-in"
105
- x-transition:leave-end="translate-x-full">
109
+ x-transition:leave-end="translate-x-full">
106
110
<ul class="text-content p-6 font-semibold">
107
111
<li class="flex justify-between items-center">
108
112
<a href="<%s Url.index %>">
155
159
</li>
156
160
</ul>
157
161
</nav>
162
+ <% if git_branch <> "main" then %>
163
+ <div id="alert-border-2" class="flex items-center p-4 mb-4 text-red-800 border-t-4 border-red-300 bg-red-50 dark:text-red-400 dark:bg-gray-800 dark:border-red-800" role="alert">
164
+ <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">
165
+ <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"/>
166
+ </svg>
167
+ <div class="ms-3 text-sm font-medium">
168
+ You are viewieng 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 @
169
+ <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>,
170
+ not the <a class="font-semibold underline hover:no-underline" href="https://rocq-prover.org">live version</a>.
171
+ </div>
172
+ <button type="button" class="ms-auto -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">
173
+ <span class="sr-only">Dismiss</span>
174
+ <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
175
+ <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"/>
176
+ </svg>
177
+ </button>
178
+ </div>
158
179
</header>
180
+ <link rel="stylesheet" href="https://unpkg.com/
[email protected] /dist/flowbite.min.css" />
181
+ <script src="https://unpkg.com/
[email protected] /dist/flowbite.js"></script>
159
182
<%s! Search.script %>
0 commit comments