81 lines
2.2 KiB
PHP
81 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* Docs Footer Partial
|
|
* app/Views/docs/partials/docs_footer.php
|
|
*
|
|
* Closes the body/html tags and initialises highlight.js.
|
|
* Always the last partial on every docs page.
|
|
*
|
|
* Variables:
|
|
* $app_name (string) — defaults to 'Nhance PAM'
|
|
*/
|
|
|
|
$app_name = $app_name ?? 'Nhance PAM';
|
|
$year = date('Y');
|
|
?>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
// Syntax highlighting
|
|
if (window.hljs) hljs.highlightAll();
|
|
|
|
// Active TOC link on scroll
|
|
const tocLinks = document.querySelectorAll('.docs-toc a');
|
|
const headings = document.querySelectorAll('main h2, main h3');
|
|
|
|
if (tocLinks.length && headings.length) {
|
|
const observer = new IntersectionObserver(
|
|
(entries) => {
|
|
entries.forEach(entry => {
|
|
if (entry.isIntersecting) {
|
|
tocLinks.forEach(l => l.classList.remove('is-active-toc'));
|
|
const match = document.querySelector(
|
|
`.docs-toc a[href="#${entry.target.id}"]`
|
|
);
|
|
if (match) match.classList.add('is-active-toc');
|
|
}
|
|
});
|
|
},
|
|
{ rootMargin: '0px 0px -70% 0px' }
|
|
);
|
|
|
|
headings.forEach(h => { if (h.id) observer.observe(h); });
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
.docs-toc a.is-active-toc { color: var(--accent); font-weight: 500; }
|
|
|
|
/* ─── GLOBAL FOOTER BAR ──────────────────── */
|
|
.docs-global-footer {
|
|
border-top : 1px solid var(--border);
|
|
padding : 16px 24px;
|
|
font-size : 12px;
|
|
color : var(--muted);
|
|
display : flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-top : auto;
|
|
}
|
|
|
|
.docs-global-footer a {
|
|
color : var(--muted);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.docs-global-footer a:hover { color: var(--accent); }
|
|
</style>
|
|
|
|
<footer class="docs-global-footer">
|
|
<span>© <?= $year ?> <?= esc($app_name) ?>. Internal developer docs.</span>
|
|
<span>
|
|
Built with CodeIgniter 4 ·
|
|
<a href="<?= base_url('docs/changelog') ?>">Changelog</a> ·
|
|
<a href="<?= base_url('docs/contributing') ?>">Contributing</a>
|
|
</span>
|
|
</footer>
|
|
|
|
</body>
|
|
</html>
|