Skip to content

Commit

Permalink
[Closes #21, #22] Fix incorrect URLs
Browse files Browse the repository at this point in the history
Replace literal strings with exports from urls.ts, so everything is defined in one place.
Fix Twitter and and LinkedIn links.
  • Loading branch information
fwextensions committed Nov 23, 2024
1 parent 1ea6aac commit 8b2aeda
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
22 changes: 15 additions & 7 deletions src/components/HeaderNav.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
---
import NavLink from "./NavLink.astro";
import NavDropdown from "./NavDropdown.astro";
import { meetupURL } from "@/utils/urls";
import {
meetupURL,
getStartedURL,
aboutURL,
blogURL,
codeOfConductURL,
donateURL,
projectsURL,
} from "@/utils/urls";
import HeaderLogo from "./HeaderLogo.astro";
const routes = [
{ label: "Get Started", page: "/get-started" },
{ label: "Get Started", page: getStartedURL },
{ label: "Events", page: meetupURL },
{ label: "Projects", page: "/projects" },
{ label: "Blog", page: "/blog" },
{ label: "Donate", page: "/donate" },
{ label: "About", page: "/about",
{ label: "Projects", page: projectsURL },
{ label: "Blog", page: blogURL },
{ label: "Donate", page: donateURL },
{ label: "About", page: aboutURL,
pages: [
{ label: "Code of Conduct", page: "/about/code-of-conduct" }
{ label: "Code of Conduct", page: codeOfConductURL }
]
}
];
Expand Down
4 changes: 2 additions & 2 deletions src/pages/get-started.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import GetStartedStep from "@/components/GetStartedStep.astro";
import { base, meetupURL, memberFormURL, projectsURL, slackURL } from "@/utils/urls";
import { base, meetupURL, memberFormURL, projectsURL, slackURL, codeOfConductURL } from "@/utils/urls";
import about from "@/assets/get-started/about.webp";
import onboard from "@/assets/get-started/onboard.webp";
import attend from "@/assets/get-started/attend.webp";
Expand Down Expand Up @@ -35,7 +35,7 @@ const meta = {
>
<ol>
<li>
Read our <a href={base("/about/code-of-conduct")}>Code of Conduct</a>
Read our <a href={base(codeOfConductURL)}>Code of Conduct</a>
</li>
<li>
Read over the <a href={projectsURL}>Current Projects</a>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from "./dateFromSlug";
export * from "./getBlogImage";
export * from "./getImageAsset";
export * from "./urls";
export * from "./dayjs";
export { default as dayjs } from "./dayjs";
export { base } from "./urls";
15 changes: 11 additions & 4 deletions src/utils/urls.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
export const projectsURL = "https://sfbrigade.notion.site/Current-Projects-4fefa377e1424ff0b59230b9c160e6a4";
// internal paths
export const getStartedURL = "/get-started";
export const projectsURL = "/projects";
export const blogURL = "/blog";
export const donateURL = "/donate";
export const aboutURL = "/about";
export const codeOfConductURL = "/about/code-of-conduct";

// external URLs
export const wikiURL = "https://sfbrigade.notion.site/Code-for-San-Francisco-Wiki-3ae6aaf3ad3f4b7a9caab1c291c60081";
export const proposeTalkURL = "https://docs.google.com/forms/d/e/1FAIpQLScHe7aWQ-2n3lSTU1WfcK8rhBZp8pkDGH9EcJdbQb5lqMbbzA/viewform";
export const pitchProjectURL = "https://docs.google.com/forms/d/e/1FAIpQLSexe5qvmJ6LTiU1HcR-XAzlrgPLBudVBPK_ouHeBkFz2JVUHw/viewform";
export const newsletterURL = "https://eepurl.com/bfFkF9";
export const memberFormURL = "https://c4sf.me/member";
export const slackURL = "https://c4sf.me/slack";
export const blogURL = "https://c4sf.me/blog";
export const meetupURL = "https://www.meetup.com/sfcivictech/";
export const twitterURL = "https://twitter.com/sfcivictech";
export const githubURL = "https://github.com/sfbrigade";
export const githubURL = "https://github.com/sfcivictech";
export const facebookURL = "https://www.facebook.com/sfcivictech";
export const linkedinURL = "https://www.linkedin.com/company/sfbrigade/";
export const linkedinURL = "https://www.linkedin.com/company/sfcivictech/";
export const zoomURL = "https://c4sf.me/zoom";

export const base = (url: string) => url.startsWith("/") ? (import.meta.env.BASE_URL + url).replace("//", "/") : url;

0 comments on commit 8b2aeda

Please sign in to comment.