From 283561cc76633b0aba8899ab047f1b963beeab1d Mon Sep 17 00:00:00 2001 From: Brian Montgomery Date: Wed, 25 Feb 2026 20:18:37 -0500 Subject: [PATCH] Fixed `useable` and `fixable` redirects. Refactored the navigation components. --- astro/astro.config.mjs | 3 + astro/src/components/Footer.astro | 299 ++++-------------- astro/src/components/Header.astro | 2 +- astro/src/components/HeaderER.astro | 2 +- astro/src/components/NavSiteList.astro | 218 ------------- .../navigation/FooterLinkList.astro | 62 ++++ .../navigation/NavDropdownMenu.astro | 83 +++++ .../components/navigation/NavSiteList.astro | 68 ++++ .../{ => navigation}/NavSiteSecondary.astro | 4 +- astro/src/content.config.ts | 24 +- astro/src/content/navigation/about.json | 16 + astro/src/content/navigation/outreach.json | 15 + astro/src/content/navigation/policies.json | 26 ++ astro/src/content/navigation/projects.json | 47 +++ astro/src/content/navigation/recruit.json | 13 + .../src/content/navigation/social-media.json | 23 ++ astro/src/content/navigation/team.json | 22 ++ 17 files changed, 463 insertions(+), 464 deletions(-) delete mode 100644 astro/src/components/NavSiteList.astro create mode 100644 astro/src/components/navigation/FooterLinkList.astro create mode 100644 astro/src/components/navigation/NavDropdownMenu.astro create mode 100644 astro/src/components/navigation/NavSiteList.astro rename astro/src/components/{ => navigation}/NavSiteSecondary.astro (96%) create mode 100644 astro/src/content/navigation/about.json create mode 100644 astro/src/content/navigation/outreach.json create mode 100644 astro/src/content/navigation/policies.json create mode 100644 astro/src/content/navigation/projects.json create mode 100644 astro/src/content/navigation/recruit.json create mode 100644 astro/src/content/navigation/social-media.json create mode 100644 astro/src/content/navigation/team.json diff --git a/astro/astro.config.mjs b/astro/astro.config.mjs index 72bb2f5d..0280463a 100644 --- a/astro/astro.config.mjs +++ b/astro/astro.config.mjs @@ -40,6 +40,9 @@ export default defineConfig({ "/services/globa11y/": "/globa11y/", "/services/mutua11y/": "/mutua11y/", "/services/tip-of-the-week": "/tips/", + // Redirect to Github projects + "/fixable": "https://accessiblecommunity.github.io/fixable/", + "/useable": "https://accessiblecommunity.github.io/useable/", }, vite: { diff --git a/astro/src/components/Footer.astro b/astro/src/components/Footer.astro index 5fcff5cf..33b82ee6 100644 --- a/astro/src/components/Footer.astro +++ b/astro/src/components/Footer.astro @@ -1,15 +1,8 @@ --- -import { Icon } from "astro-icon/components"; - -import Branding from "./Branding.astro"; -import ExternalLink from "./ExternalLink.astro"; +import { getEntry } from "astro:content"; const currentYear = new Date().getFullYear(); -const facebookURL = "https://www.facebook.com/AccessibleCommunity"; -const linkedinURL = "https://in.linkedin.com/company/accessible-community"; -const instagramURL = "https://www.instagram.com/accessible_community/"; - const ContactUs = [ { name: "Mailing Address", @@ -37,211 +30,59 @@ const ContactUs = [ */ ]; -const Socials = [ - { - name: "Facebook", - icon: "bi:facebook", - href: facebookURL, - className: "bi bi-facebook social-icon", - }, - { - name: "LinkedIn", - icon: "bi:linkedin", - href: linkedinURL, - className: "bi bi-linkedin social-icon", - }, - { - name: "Instagram", - icon: "bi:instagram", - href: instagramURL, - className: "bi bi-instagram social-icon", - }, -]; +const socialEntry = await getEntry("navigation", "social-media"); +const Socials = socialEntry?.data.groups[0]; + +import Branding from "./Branding.astro"; +import FooterLinkList from "./navigation/FooterLinkList.astro"; +import { Icon } from "astro-icon/components"; --- diff --git a/astro/src/components/Header.astro b/astro/src/components/Header.astro index d62d703a..99057d41 100644 --- a/astro/src/components/Header.astro +++ b/astro/src/components/Header.astro @@ -10,7 +10,7 @@ interface Props { import { isEmpty } from "lodash-es"; import { Icon } from "astro-icon/components"; import Branding from "./Branding.astro"; -import NavSiteList from "./NavSiteList.astro"; +import NavSiteList from "@components/navigation/NavSiteList.astro"; const { title, brandedTitle = false, crumbs = [], } = Astro.props; const breadCrumbs: Breadcrumbs = diff --git a/astro/src/components/HeaderER.astro b/astro/src/components/HeaderER.astro index 3c68f638..90c8d23b 100644 --- a/astro/src/components/HeaderER.astro +++ b/astro/src/components/HeaderER.astro @@ -1,7 +1,7 @@ --- import { Icon } from "astro-icon/components"; import Branding from "@components/Branding.astro"; -import SiteNav from "./NavSiteSecondary.astro"; +import SiteNav from "@components/navigation/NavSiteSecondary.astro"; import { areSimilarURLs } from "@lib/links"; const navLinks = [{ diff --git a/astro/src/components/NavSiteList.astro b/astro/src/components/NavSiteList.astro deleted file mode 100644 index 929ab6b1..00000000 --- a/astro/src/components/NavSiteList.astro +++ /dev/null @@ -1,218 +0,0 @@ ---- -import { Icon } from "astro-icon/components"; -import Branding from "@components/Branding.astro"; -import ExternalLink from "@components/ExternalLink.astro"; - -interface Props { - main?: boolean; - class?: string; -} - -const { main = false, class: classes = "" } = Astro.props; ---- - - - - { - main && ( - - Donate - - ) - } - - - diff --git a/astro/src/components/navigation/FooterLinkList.astro b/astro/src/components/navigation/FooterLinkList.astro new file mode 100644 index 00000000..1ca8917e --- /dev/null +++ b/astro/src/components/navigation/FooterLinkList.astro @@ -0,0 +1,62 @@ +--- +import { getEntry } from 'astro:content'; + +interface Props { + name: string; +} + +const { name } = Astro.props; +const entry = await getEntry("navigation", name); + +if (entry === undefined) + throw new Error(`Could not find navigation entry '${name}'.`); + +const { data } = entry; + +import Branding from '@components/Branding.astro'; +import ExternalLink from '@components/ExternalLink.astro'; +import { Icon } from "astro-icon/components"; +--- + +

+ + + + \ No newline at end of file diff --git a/astro/src/components/navigation/NavDropdownMenu.astro b/astro/src/components/navigation/NavDropdownMenu.astro new file mode 100644 index 00000000..bc067bf8 --- /dev/null +++ b/astro/src/components/navigation/NavDropdownMenu.astro @@ -0,0 +1,83 @@ +--- +import { getEntry } from 'astro:content'; + +interface Props { + name: string; +} + +const { name } = Astro.props; +const entry = await getEntry("navigation", name); + +if (entry === undefined) + throw new Error(`Could not find navigation entry '${name}'.`); + +const { data } = entry; + +import Branding from '@components/Branding.astro'; +import ExternalLink from '@components/ExternalLink.astro'; +import { Icon } from "astro-icon/components"; +--- + + + + \ No newline at end of file diff --git a/astro/src/components/navigation/NavSiteList.astro b/astro/src/components/navigation/NavSiteList.astro new file mode 100644 index 00000000..72b2f94b --- /dev/null +++ b/astro/src/components/navigation/NavSiteList.astro @@ -0,0 +1,68 @@ +--- +import NavDropdownMenu from "./NavDropdownMenu.astro"; + +interface Props { + main?: boolean; + class?: string; +} + +const { main = false, class: classes = "" } = Astro.props; +--- + + + + { + main && ( + + Donate + + ) + } + + + diff --git a/astro/src/components/NavSiteSecondary.astro b/astro/src/components/navigation/NavSiteSecondary.astro similarity index 96% rename from astro/src/components/NavSiteSecondary.astro rename to astro/src/components/navigation/NavSiteSecondary.astro index 9e1f586f..4672a482 100644 --- a/astro/src/components/NavSiteSecondary.astro +++ b/astro/src/components/navigation/NavSiteSecondary.astro @@ -53,8 +53,8 @@ const { "page-nav-id": pageNavId = undefined } = Astro.props; // outline: 1px solid white; // } - @import "../styles/dark-mode.scss"; - @import "../styles/responsive-sizing.scss"; + @import "src/styles/dark-mode.scss"; + @import "src/styles/responsive-sizing.scss"; .navbar { min-width: 320px; diff --git a/astro/src/content.config.ts b/astro/src/content.config.ts index 9ffd87bc..adc5550c 100644 --- a/astro/src/content.config.ts +++ b/astro/src/content.config.ts @@ -30,7 +30,28 @@ const blogs = defineCollection({ const markdown = defineCollection({ loader: glob({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/markdown" }), -}) +}); + +const navigation = defineCollection({ + loader: glob({ pattern: "**/[^_]*.json", base: "./src/content/navigation" }), + schema: z.object({ + "name": z.string(), + "fullName": z.string().optional(), + "groups": z.array( + z.object({ + name: z.string(), + branded: z.boolean().default(false), + href: z.string(), + external: z.boolean().default(false), + icon: z.string().optional(), + iconCls: z.string().optional(), + }).array(), + ) + }).transform((data) => ({ + ...data, + fullName: data.fullName || data.name, + })), +}); const policies = defineCollection({ loader: glob({ @@ -234,6 +255,7 @@ export const collections = { // escapeRoomKits, escapeRoomThemes, markdown, + navigation, podcastShows, quotes, policies, diff --git a/astro/src/content/navigation/about.json b/astro/src/content/navigation/about.json new file mode 100644 index 00000000..056bdbd3 --- /dev/null +++ b/astro/src/content/navigation/about.json @@ -0,0 +1,16 @@ +{ + "name": "About", + "fullName": "About Us", + "groups": [ + [{ + "name": "Mission & Vision", + "href": "/about/mission/" + }, { + "name": "Founder's Story", + "href": "/about/story/" + }, { + "name": "Our Policies", + "href": "/about/policies/" + }] + ] +} \ No newline at end of file diff --git a/astro/src/content/navigation/outreach.json b/astro/src/content/navigation/outreach.json new file mode 100644 index 00000000..9dfcbaf7 --- /dev/null +++ b/astro/src/content/navigation/outreach.json @@ -0,0 +1,15 @@ +{ + "name": "Outreach", + "groups": [ + [{ + "name": "Tip of the Week", + "href": "/tips/" + }, { + "name": "Our Blog", + "href": "/blog/" + }, { + "name": "Our Podcasts", + "href": "/podcasts/" + }] + ] +} \ No newline at end of file diff --git a/astro/src/content/navigation/policies.json b/astro/src/content/navigation/policies.json new file mode 100644 index 00000000..cb0fa9f5 --- /dev/null +++ b/astro/src/content/navigation/policies.json @@ -0,0 +1,26 @@ +{ + "name": "Policies", + "fullName": "Our Policies", + "groups": [ + [{ + "name": "Accessibility Statement", + "href": "/accessibility-statement/" + }, { + "name": "Privacy Policy", + "href": "/privacy-policy/" + }], + [{ + "name": "Code of Conduct", + "href": "/code-of-conduct/" + }, { + "name": "Harrassment Policy", + "href": "/harrassment-policy/" + }, { + "name": "Non-Discrimination Policy", + "href": "/non-discrimination-policy/" + }, { + "name": "Technology Policy", + "href": "/technology-policy/" + }] + ] +} \ No newline at end of file diff --git a/astro/src/content/navigation/projects.json b/astro/src/content/navigation/projects.json new file mode 100644 index 00000000..3c650776 --- /dev/null +++ b/astro/src/content/navigation/projects.json @@ -0,0 +1,47 @@ +{ + "name": "Projects", + "fullName": "Our Projects", + "groups": [ + [{ + "name": "ta11y.org", + "branded": true, + "href": "https://www.ta11y.org", + "external": true, + "icon": "ta11y-logo" + }, { + "name": "mutua11y mentoring", + "branded": true, + "href": "/mutua11y/", + "icon": "mutua11y-logo", + "iconCls": "gi" + }, { + "name": "globa11y pilot", + "href": "/globa11y/", + "branded": true, + "icon": "globa11y-logo", + "iconCls": "gi" + }], + [{ + "name": "Accessible Escape Room", + "branded": true, + "href": "/escape-room/" + }, { + "name": "Digital Evaluations", + "href": "/evaluations/" + }], + [{ + "name": "Digital Accessibility Framework", + "href": "/daf/" + }, { + "name": "fixable", + "branded": true, + "href": "https://accessiblecommunity.github.io/fixable/", + "external": true + }, { + "name": "useable", + "branded": true, + "href": "https://accessiblecommunity.github.io/useable/", + "external": true + }] + ] +} \ No newline at end of file diff --git a/astro/src/content/navigation/recruit.json b/astro/src/content/navigation/recruit.json new file mode 100644 index 00000000..6bf202eb --- /dev/null +++ b/astro/src/content/navigation/recruit.json @@ -0,0 +1,13 @@ +{ + "name": "Join us", + "fullName": "Join Us", + "groups": [ + [{ + "name": "Volunteer", + "href": "/volunteer/" + }, { + "name": "Donate", + "href": "/donate/" + }] + ] +} \ No newline at end of file diff --git a/astro/src/content/navigation/social-media.json b/astro/src/content/navigation/social-media.json new file mode 100644 index 00000000..6e260f40 --- /dev/null +++ b/astro/src/content/navigation/social-media.json @@ -0,0 +1,23 @@ +{ + "name": "Social Media", + "fullName": "Social Media", + "groups": [ + [{ + "name": "Facebook", + "href": "https://www.facebook.com/AccessibleCommunity", + "external": true, + "icon": "bi:facebook", + "iconCls": "bi bi-facebook" + }, { + "name": "LinkedIn", + "href": "https://in.linkedin.com/company/accessible-community", + "icon": "bi:linkedin", + "iconCls": "bi bi-linkedin" + }, { + "name": "Instagram", + "href": "https://www.instagram.com/accessible_community/", + "icon": "bi:instagram", + "iconCls": "bi bi-instagram" + }] + ] +} \ No newline at end of file diff --git a/astro/src/content/navigation/team.json b/astro/src/content/navigation/team.json new file mode 100644 index 00000000..f95c3e73 --- /dev/null +++ b/astro/src/content/navigation/team.json @@ -0,0 +1,22 @@ +{ + "name": "Team", + "fullName": "Our Team", + "groups": [ + [{ + "name": "Board Members", + "href": "/team/board/" + }, { + "name": "Leadership Team", + "href": "/team/leadership/" + }, { + "name": "Staff", + "href": "/team/staff/" + }, { + "name": "Partners", + "href": "/team/partners/" + }, { + "name": "Previous Contributors", + "href": "/team/previous/" + }] + ] +} \ No newline at end of file