Skip to content

Commit 8b2aeda

Browse files
committed
[Closes #21, #22] Fix incorrect URLs
Replace literal strings with exports from urls.ts, so everything is defined in one place. Fix Twitter and and LinkedIn links.
1 parent 1ea6aac commit 8b2aeda

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

src/components/HeaderNav.astro

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
---
22
import NavLink from "./NavLink.astro";
33
import NavDropdown from "./NavDropdown.astro";
4-
import { meetupURL } from "@/utils/urls";
4+
import {
5+
meetupURL,
6+
getStartedURL,
7+
aboutURL,
8+
blogURL,
9+
codeOfConductURL,
10+
donateURL,
11+
projectsURL,
12+
} from "@/utils/urls";
513
import HeaderLogo from "./HeaderLogo.astro";
614
715
const routes = [
8-
{ label: "Get Started", page: "/get-started" },
16+
{ label: "Get Started", page: getStartedURL },
917
{ label: "Events", page: meetupURL },
10-
{ label: "Projects", page: "/projects" },
11-
{ label: "Blog", page: "/blog" },
12-
{ label: "Donate", page: "/donate" },
13-
{ label: "About", page: "/about",
18+
{ label: "Projects", page: projectsURL },
19+
{ label: "Blog", page: blogURL },
20+
{ label: "Donate", page: donateURL },
21+
{ label: "About", page: aboutURL,
1422
pages: [
15-
{ label: "Code of Conduct", page: "/about/code-of-conduct" }
23+
{ label: "Code of Conduct", page: codeOfConductURL }
1624
]
1725
}
1826
];

src/pages/get-started.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import BaseLayout from "@/layouts/BaseLayout.astro";
33
import GetStartedStep from "@/components/GetStartedStep.astro";
4-
import { base, meetupURL, memberFormURL, projectsURL, slackURL } from "@/utils/urls";
4+
import { base, meetupURL, memberFormURL, projectsURL, slackURL, codeOfConductURL } from "@/utils/urls";
55
import about from "@/assets/get-started/about.webp";
66
import onboard from "@/assets/get-started/onboard.webp";
77
import attend from "@/assets/get-started/attend.webp";
@@ -35,7 +35,7 @@ const meta = {
3535
>
3636
<ol>
3737
<li>
38-
Read our <a href={base("/about/code-of-conduct")}>Code of Conduct</a>
38+
Read our <a href={base(codeOfConductURL)}>Code of Conduct</a>
3939
</li>
4040
<li>
4141
Read over the <a href={projectsURL}>Current Projects</a>

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export * from "./dateFromSlug";
22
export * from "./getBlogImage";
33
export * from "./getImageAsset";
4-
export * from "./urls";
54
export * from "./dayjs";
65
export { default as dayjs } from "./dayjs";
6+
export { base } from "./urls";

src/utils/urls.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
export const projectsURL = "https://sfbrigade.notion.site/Current-Projects-4fefa377e1424ff0b59230b9c160e6a4";
1+
// internal paths
2+
export const getStartedURL = "/get-started";
3+
export const projectsURL = "/projects";
4+
export const blogURL = "/blog";
5+
export const donateURL = "/donate";
6+
export const aboutURL = "/about";
7+
export const codeOfConductURL = "/about/code-of-conduct";
8+
9+
// external URLs
210
export const wikiURL = "https://sfbrigade.notion.site/Code-for-San-Francisco-Wiki-3ae6aaf3ad3f4b7a9caab1c291c60081";
311
export const proposeTalkURL = "https://docs.google.com/forms/d/e/1FAIpQLScHe7aWQ-2n3lSTU1WfcK8rhBZp8pkDGH9EcJdbQb5lqMbbzA/viewform";
412
export const pitchProjectURL = "https://docs.google.com/forms/d/e/1FAIpQLSexe5qvmJ6LTiU1HcR-XAzlrgPLBudVBPK_ouHeBkFz2JVUHw/viewform";
513
export const newsletterURL = "https://eepurl.com/bfFkF9";
614
export const memberFormURL = "https://c4sf.me/member";
715
export const slackURL = "https://c4sf.me/slack";
8-
export const blogURL = "https://c4sf.me/blog";
916
export const meetupURL = "https://www.meetup.com/sfcivictech/";
1017
export const twitterURL = "https://twitter.com/sfcivictech";
11-
export const githubURL = "https://github.com/sfbrigade";
18+
export const githubURL = "https://github.com/sfcivictech";
1219
export const facebookURL = "https://www.facebook.com/sfcivictech";
13-
export const linkedinURL = "https://www.linkedin.com/company/sfbrigade/";
20+
export const linkedinURL = "https://www.linkedin.com/company/sfcivictech/";
1421
export const zoomURL = "https://c4sf.me/zoom";
1522

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

0 commit comments

Comments
 (0)