mirror of
https://github.com/Xevion/utsa-handbook.git
synced 2025-12-06 01:16:46 -06:00
Fix unused imports, fix deprecated func usage
This commit is contained in:
@@ -11,7 +11,7 @@ const getLinkClasses = (link: Link) => {
|
|||||||
|
|
||||||
return clsx(baseClasses, {
|
return clsx(baseClasses, {
|
||||||
// Classes for when the link is not the current page
|
// Classes for when the link is not the current page
|
||||||
"dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400": !isCurrent,
|
"dark:border-l-zinc-600 text-zinc-500 dark:hover:text-zinc-300 dark:text-zinc-400": !isCurrent,
|
||||||
// Classes for when the link is the current page
|
// Classes for when the link is the current page
|
||||||
"dark:border-l-zinc-500 text-zinc-900 dark:text-zinc-200": isCurrent,
|
"dark:border-l-zinc-500 text-zinc-900 dark:text-zinc-200": isCurrent,
|
||||||
});
|
});
|
||||||
@@ -23,7 +23,7 @@ const sidebar = await get();
|
|||||||
<nav aria-labelledby="grid-left" class="w-64 p-4 border-r dark:border-r-zinc-500">
|
<nav aria-labelledby="grid-left" class="w-64 p-4 border-r dark:border-r-zinc-500">
|
||||||
<ul>
|
<ul>
|
||||||
{sidebar.map(item => (item.header ?
|
{sidebar.map(item => (item.header ?
|
||||||
<h2 class="mt-4 font-semibold text-slate-700 dark:text-slate-200">{item.text}</h2> :
|
<h2 class="mt-4 font-semibold text-zinc-700 dark:text-zinc-300">{item.text}</h2> :
|
||||||
<li class={getLinkClasses(item)}>
|
<li class={getLinkClasses(item)}>
|
||||||
<a href={item.link}>{item.text}</a>
|
<a href={item.link}>{item.text}</a>
|
||||||
</li>))}
|
</li>))}
|
||||||
@@ -32,7 +32,7 @@ const sidebar = await get();
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
window.addEventListener('DOMContentLoaded', (event) => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
var target = document.querySelector('[aria-current="page"]');
|
var target = document.querySelector('[aria-current="page"]');
|
||||||
if (target && target.offsetTop > window.innerHeight - 100) {
|
if (target && target.offsetTop > window.innerHeight - 100) {
|
||||||
document.querySelector('.nav-groups').scrollTop = target.offsetTop;
|
document.querySelector('.nav-groups').scrollTop = target.offsetTop;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getCollection, getEntries, type CollectionEntry } from "astro:content";
|
import { getCollection, type CollectionEntry } from "astro:content";
|
||||||
|
|
||||||
export type Link = {
|
export type Link = {
|
||||||
text: string;
|
text: string;
|
||||||
@@ -22,7 +22,7 @@ const headerOrder: Record<string, number> = {
|
|||||||
*/
|
*/
|
||||||
function toTitleCase(s: string): string {
|
function toTitleCase(s: string): string {
|
||||||
return s.replace(/\w\S*/g, function (txt) {
|
return s.replace(/\w\S*/g, function (txt) {
|
||||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
return txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user