Skip to content

Commit b056ad8

Browse files
committed
Link to website commit in footer
1 parent b00be94 commit b056ad8

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
.DEFAULT_GOAL := all
22
DOC_PATH=`pwd`/rocq-doc/
3+
GIT_HEAD=`git rev-parse HEAD`
4+
GIT_COMMIT=${GIT_HEAD}`git diff --quiet HEAD || echo "-dirty"`
35

46
.PHONY: all
57
all:
68
opam exec -- dune build --root .
79

10+
.PHONY: show-config
11+
show-config:
12+
@echo "DOC_PATH="${DOC_PATH}
13+
@echo "GIT_COMMIT="${GIT_COMMIT}
14+
815
.PHONY: deps
916
deps: create_switch ## Install development dependencies
1017
opam install -y ocamlformat=0.26.2 ocaml-lsp-server
@@ -65,7 +72,7 @@ fmt: ## Format the codebase with ocamlformat
6572

6673
.PHONY: watch
6774
watch: update-local-doc ## Watch for the filesystem and rebuild on every change
68-
DOC_PATH=${DOC_PATH} opam exec -- dune build @run -w --force --no-buffer
75+
DOC_PATH=${DOC_PATH} GIT_COMMIT=${GIT_COMMIT} opam exec -- dune build @run -w --force --no-buffer
6976

7077
.PHONY: utop
7178
utop: ## Run a REPL and link with the project's libraries

src/rocqproverorg_frontend/components/footer.eml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,21 @@ let primary_footer () =
142142
<%s! icon "h-6 w-6" %>
143143
</a>
144144
in
145+
let link ~href ~name =
146+
<a href="<%s href %>" class="text-base leading-6 text-content dark:text-dark-title hover:text-primary dark:hover:text-dark-primary"><%s name %></a>
147+
in
145148
let footer_link ~href ~name =
146149
<li>
147-
<a href="<%s href %>" class="text-base leading-6 text-content dark:text-dark-title hover:text-primary dark:hover:text-dark-primary"><%s name %></a>
150+
<%s! link ~href ~name %>
148151
</li>
149152
in
150153

151154
<footer x-data class="border-t border-separator_30 dark:border-dark-separator_30 bg-dark-sand dark:bg-dark-card" aria-labelledby="footer-heading">
152155
<h2 id="footer-heading" class="sr-only">Footer</h2>
153156
<div class="mx-auto max-w-7xl px-6 py-16 lg:px-8">
154157
<div class="flex w-full items-center justify-between mb-8">
155-
<a href="<%s Url.index %>"><img class="h-8 dark:hidden" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-blue_orange.svg" %>" alt="OCaml">
156-
<img class="h-8 hidden dark:inline" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" alt="OCaml">
158+
<a href="<%s Url.index %>"><img class="h-8 dark:hidden" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-blue_orange.svg" %>" alt="Rocq">
159+
<img class="h-8 hidden dark:inline" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" alt="Rocq">
157160
</a>
158161
<div class="hidden md:flex">
159162
<%s! LightDarkModeSwitch.render %>
@@ -170,6 +173,11 @@ let primary_footer () =
170173
<div class="flex w-full md:hidden">
171174
<%s! LightDarkModeSwitch.render %>
172175
</div>
176+
<div class="flex mt-6 space-y-4">
177+
<% let commit = try Sys.getenv "GIT_COMMIT" with Not_found -> failwith "Environment variable GIT_COMMIT is not set" in %>
178+
<%s! link ~href:("https://github.com/coq/rocq-prover.org/commit/" ^ commit) ~name:"GitHub Source" %>
179+
<% ; %>
180+
</div>
173181
</div>
174182
<div class="mt-8 grid grid-cols-2 gap-8 xl:col-span-2 xl:mt-0">
175183
<div class="md:grid md:grid-cols-2 md:gap-8">
@@ -227,8 +235,8 @@ let secondary_footer () =
227235
<footer x-data class="flex flex-col gap-3 md:gap-5 pt-5 mt-6 border-separator_20 dark:border-dark-separator_30 border-t">
228236
<div class="flex w-full items-center justify-between">
229237
<a href="<%s Url.index %>">
230-
<img class="h-8 dark:hidden" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-blue_orange.svg" %>" alt="OCaml">
231-
<img src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" width="132" alt="OCaml logo" class="h-8 hidden dark:inline">
238+
<img class="h-8 dark:hidden" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-blue_orange.svg" %>" alt="Rocq">
239+
<img src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" width="132" alt="Rocq logo" class="h-8 hidden dark:inline">
232240
</a>
233241
<div class="hidden md:flex">
234242
<%s! LightDarkModeSwitch.render %>

0 commit comments

Comments
 (0)