Skip to content

Commit

Permalink
Link to website commit in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattam82 committed Jan 16, 2025
1 parent b00be94 commit b056ad8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
.DEFAULT_GOAL := all
DOC_PATH=`pwd`/rocq-doc/
GIT_HEAD=`git rev-parse HEAD`
GIT_COMMIT=${GIT_HEAD}`git diff --quiet HEAD || echo "-dirty"`

.PHONY: all
all:
opam exec -- dune build --root .

.PHONY: show-config
show-config:
@echo "DOC_PATH="${DOC_PATH}
@echo "GIT_COMMIT="${GIT_COMMIT}

.PHONY: deps
deps: create_switch ## Install development dependencies
opam install -y ocamlformat=0.26.2 ocaml-lsp-server
Expand Down Expand Up @@ -65,7 +72,7 @@ fmt: ## Format the codebase with ocamlformat

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

.PHONY: utop
utop: ## Run a REPL and link with the project's libraries
Expand Down
18 changes: 13 additions & 5 deletions src/rocqproverorg_frontend/components/footer.eml
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,21 @@ let primary_footer () =
<%s! icon "h-6 w-6" %>
</a>
in
let link ~href ~name =
<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>
in
let footer_link ~href ~name =
<li>
<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>
<%s! link ~href ~name %>
</li>
in

<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">
<h2 id="footer-heading" class="sr-only">Footer</h2>
<div class="mx-auto max-w-7xl px-6 py-16 lg:px-8">
<div class="flex w-full items-center justify-between mb-8">
<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">
<img class="h-8 hidden dark:inline" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" alt="OCaml">
<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">
<img class="h-8 hidden dark:inline" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" alt="Rocq">
</a>
<div class="hidden md:flex">
<%s! LightDarkModeSwitch.render %>
Expand All @@ -170,6 +173,11 @@ let primary_footer () =
<div class="flex w-full md:hidden">
<%s! LightDarkModeSwitch.render %>
</div>
<div class="flex mt-6 space-y-4">
<% let commit = try Sys.getenv "GIT_COMMIT" with Not_found -> failwith "Environment variable GIT_COMMIT is not set" in %>
<%s! link ~href:("https://github.com/coq/rocq-prover.org/commit/" ^ commit) ~name:"GitHub Source" %>
<% ; %>
</div>
</div>
<div class="mt-8 grid grid-cols-2 gap-8 xl:col-span-2 xl:mt-0">
<div class="md:grid md:grid-cols-2 md:gap-8">
Expand Down Expand Up @@ -227,8 +235,8 @@ let secondary_footer () =
<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">
<div class="flex w-full items-center justify-between">
<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">
<img src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" width="132" alt="OCaml logo" class="h-8 hidden dark:inline">
<img class="h-8 dark:hidden" src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-blue_orange.svg" %>" alt="Rocq">
<img src="<%s Rocqproverorg_static.Asset.url "logos/logo-rocq-white.svg" %>" width="132" alt="Rocq logo" class="h-8 hidden dark:inline">
</a>
<div class="hidden md:flex">
<%s! LightDarkModeSwitch.render %>
Expand Down

1 comment on commit b056ad8

@Zimmi48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit seems to have broken our CI.

Please sign in to comment.