Skip to content

Commit 8168b3c

Browse files
feat: add version tag (bottom-left) and CON branding (bottom-right) footer, CI version check
- Download Center for Open Neuroscience logo to src/assets/con-logo.png - Inject __APP_VERSION__ from package.json via Vite define in configs/vite.config.js - Add <footer> to src/index.html: version span (left) + CON logo link (right) - Combine initTheme + version-setter into single DOMContentLoaded in src/plots.js - Add footer CSS to src/styles.css: flex layout, monospace version, logo theme filter - Add .github/workflows/version-check.yml: CI check that PRs to main bump package.json version Agent-Logs-Url: https://github.com/dandi/access-page/sessions/8394a136-3858-46d1-86b1-1ac8e9893953 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
1 parent ecb29d0 commit 8168b3c

6 files changed

Lines changed: 88 additions & 2 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Version Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version-check:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Check version bump
20+
run: |
21+
PR_VERSION=$(node -p "require('./package.json').version")
22+
BASE_VERSION=$(git show origin/${{ github.base_ref }}:package.json | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>console.log(JSON.parse(d).version))")
23+
echo "Base version: $BASE_VERSION"
24+
echo "PR version: $PR_VERSION"
25+
if [ "$PR_VERSION" = "$BASE_VERSION" ]; then
26+
echo "::error::Version has not been bumped. Please update the version in package.json."
27+
exit 1
28+
fi
29+
echo "Version bumped from $BASE_VERSION to $PR_VERSION ✓"

configs/vite.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { defineConfig } from "vite";
2+
import { readFileSync } from "node:fs";
3+
4+
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url)));
25

36
export default defineConfig({
47
root: "src",
@@ -8,4 +11,7 @@ export default defineConfig({
811
outDir: "../dist",
912
emptyOutDir: true,
1013
},
14+
define: {
15+
__APP_VERSION__: JSON.stringify(version),
16+
},
1117
});

src/assets/con-logo.png

36.4 KB
Loading

src/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@
211211
</div>
212212
</div>
213213
</div>
214+
<footer class="site-footer">
215+
<span class="site-version" id="site_version"></span>
216+
<a href="https://centerforopenneuroscience.org" class="con-brand" target="_blank" rel="noopener" aria-label="Center for Open Neuroscience">
217+
<img src="./assets/con-logo.png" alt="Center for Open Neuroscience" class="con-logo">
218+
</a>
219+
</footer>
214220
<div id="analytics_consent_banner" class="consent-banner" hidden role="region" aria-label="Analytics consent">
215221
<p class="consent-banner-text">We use analytics tracking to understand how this page is used. No tracking is enabled unless you accept.</p>
216222
<div class="consent-banner-actions">

src/plots.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,15 @@ function render_sortable_table(container_id, title, columns, rows, data_url) {
338338

339339
// Initialise the theme as early as possible (before plots are rendered) so
340340
// that CSS variables and IS_DARK_MODE are in sync from the very first paint.
341-
document.addEventListener("DOMContentLoaded", initTheme);
341+
document.addEventListener("DOMContentLoaded", () => {
342+
initTheme();
343+
344+
// Set the version tag in the footer
345+
const versionEl = document.getElementById("site_version");
346+
if (versionEl) {
347+
versionEl.textContent = `v${__APP_VERSION__}`;
348+
}
349+
});
342350

343351
// Handle section anchor link clicks: update the URL hash via pushState so the
344352
// address bar reflects the section link, but without triggering a popstate

src/styles.css

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ body {
3838
color: var(--color-text);
3939
background: var(--color-bg);
4040
margin: 0;
41-
padding: 0 0 40px;
41+
padding: 0;
4242
-webkit-font-smoothing: antialiased;
4343
}
4444

@@ -737,3 +737,40 @@ input[type="number"]:focus {
737737
flex-direction: column;
738738
}
739739
}
740+
741+
/* ── Site footer ── */
742+
.site-footer {
743+
display: flex;
744+
align-items: center;
745+
justify-content: space-between;
746+
padding: 12px 20px 20px;
747+
margin-top: 24px;
748+
border-top: 1px solid var(--color-border);
749+
}
750+
751+
.site-version {
752+
color: var(--color-text-secondary);
753+
font-size: 0.8em;
754+
font-family: monospace;
755+
}
756+
757+
.con-brand {
758+
display: flex;
759+
align-items: center;
760+
opacity: 0.7;
761+
transition: opacity 0.15s;
762+
}
763+
764+
.con-brand:hover {
765+
opacity: 1;
766+
}
767+
768+
.con-logo {
769+
height: 32px;
770+
width: auto;
771+
filter: brightness(0) invert(1);
772+
}
773+
774+
[data-theme="light"] .con-logo {
775+
filter: none;
776+
}

0 commit comments

Comments
 (0)