Add catalog subject banner feature: Introduce optional header images for subjects in the catalog, update CONTRIBUTING.md with guidelines for adding banners, and modify catalog data structure to support banner URLs. Enhance frontend components and styles to display banners effectively. Update TypeScript types and curriculum structure to accommodate new banner functionality.

This commit is contained in:
Hananoshika Yomaru 2026-05-20 12:40:51 -07:00
parent 8a7f6449a7
commit 7636bb4a86
35 changed files with 4140 additions and 10 deletions

View file

@ -153,7 +153,21 @@ export function CatalogApp() {
</aside>
<div class="catalog-main">
<header class="catalog-header">
<header
class="catalog-header"
classList={{ "catalog-header--has-banner": Boolean(currentSubject().banner) }}
>
<Show when={currentSubject().banner}>
<div class="catalog-header__banner" aria-hidden="true">
<img
src={currentSubject().banner!}
alt=""
width={1400}
height={700}
decoding="async"
/>
</div>
</Show>
<div class="catalog-header__head">
<div class="catalog-header__intro">
<h1 class="catalog-header__title">{currentSubject().name}</h1>

View file

@ -13,6 +13,7 @@ function readConfig() {
homeUrl: "/",
browseUrl: "/catalog/",
aboutUrl: "/about/",
faqUrl: "/faq/",
searchUrl: "/search/",
contributingUrl: "/contributing/",
githubUrl: "https://github.com/openfreebooks/openfreebooks",
@ -23,6 +24,7 @@ function readConfig() {
homeUrl: string;
browseUrl: string;
aboutUrl: string;
faqUrl: string;
searchUrl: string;
contributingUrl: string;
githubUrl: string;
@ -86,6 +88,7 @@ const navLinks = [
{ label: "Browse", href: config.browseUrl },
{ label: "Search", href: config.searchUrl },
{ label: "About", href: config.aboutUrl },
{ label: "FAQ", href: config.faqUrl },
{ label: "GitHub", href: config.githubUrl },
];