Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Define and use constants for internal urls #327

Merged
1 commit merged into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions common/GlobalData.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ type navContent = {
let navContentEn = {
industrySection: {
header: `Industry`,
whatIsOcaml: {label: `What is OCaml`, url: `/industry/whatisocaml`},
industrialUsers: {label: `Industrial Users`, url: `/industry/users`},
successStories: {label: `Success Stories`, url: `/industry/successstories`},
whatIsOcaml: {label: `What is OCaml`, url: InternalUrls.industryWhatisocaml},
industrialUsers: {label: `Industrial Users`, url: InternalUrls.industryUsers},
successStories: {label: `Success Stories`, url: InternalUrls.industrySuccessstories},
},
resourcesSection: {
header: `Resources`,
releases: {label: `Releases`, url: `/resources/releases`},
applications: {label: `Applications`, url: `/resources/applications`},
language: {label: `Language`, url: `/resources/language`},
archive: {label: `Archive`, url: `/resources/archive`},
releases: {label: `Releases`, url: InternalUrls.resourcesReleases},
applications: {label: `Applications`, url: InternalUrls.resourcesApplications},
language: {label: `Language`, url: InternalUrls.resourcesLanguage},
archive: {label: `Archive`, url: InternalUrls.resourcesArchive},
},
communitySection: {
header: `Community`,
opportunities: {label: `Opportunities`, url: `/community/opportunities`},
news: {label: `News`, url: `/community/news`},
aroundTheWeb: {label: `Around the Web`, url: `/community/aroundweb`},
opportunities: {label: `Opportunities`, url: InternalUrls.communityOpportunities},
news: {label: `News`, url: InternalUrls.communityNews},
aroundTheWeb: {label: `Around the Web`, url: InternalUrls.communityAroundweb},
},
}

Expand Down Expand Up @@ -112,15 +112,18 @@ let footerContentEn: Footer.t = {
legalSection: {
header: `Legal`,
entries: [
{label: `Privacy`, url: `/legal/privacy`},
{label: `Terms`, url: `/legal/terms`},
{label: `Carbon Footprint`, url: `/legal/carbonfootprint`},
{label: `Privacy`, url: InternalUrls.legalPrivacy},
{label: `Terms`, url: InternalUrls.legalTerms},
{label: `Carbon Footprint`, url: InternalUrls.legalCarbonfootprint},
],
},
},
sponsorContent: {
thankSponsorPrefix: `Thank you to our`,
hostingProviders: {label: `Hosting Providers`, url: `/legal/carbonfootprint#hostingproviders`},
hostingProviders: {
label: `Hosting Providers`,
url: `${InternalUrls.legalCarbonfootprint}#hostingproviders`,
},
},
}

Expand Down
26 changes: 26 additions & 0 deletions common/InternalUrls.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
let index = "/"
let history = "/history"
let communityAroundweb = "/community/aroundweb"
let communityEvents = "/community/events"
let communityMediaarchive = "/community/mediaarchive"
let communityNews = "/community/news"
let communityNewsarchive = "/community/newsarchive"
let communityOpportunities = "/community/opportunities"
let industrySuccessstories = "/industry/successstories"
let industryUsers = "/industry/users"
let industryWhatisocaml = "/industry/whatisocaml"
let legalCarbonfootprint = "/legal/carbonfootprint"
let legalPrivacy = "/legal/privacy"
let legalTerms = "/legal/terms"
let resourcesBasics = "/resources/basics"
let resourcesInstallocaml = "/resources/installocaml"
let resourcesApplications = "/resources/applications"
let resourcesArchive = "/resources/archive"
let resourcesBestpractices = "/resources/bestpractices"
let resourcesDevelopinginocaml = "/resources/developinginocaml"
let resourcesLanguage = "/resources/language"
let resourcesPapers = "/resources/papers"
let resourcesPapersarchive = "/resources/papersarchive"
let resourcesPlatform = "/resources/platform"
let resourcesReleases = "/resources/releases"
let resourcesUsingocaml = "/resources/usingocaml"
4 changes: 3 additions & 1 deletion pages/community/news.res
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ module CategorizedNews = {
</div>
</div>
<div className="text-center">
<a href="/community/newsarchive" className="bg-orangedark text-white px-10 py-3 rounded">
<a
href=InternalUrls.communityNewsarchive
className="bg-orangedark text-white px-10 py-3 rounded">
{s(content.goToNewsArchive)}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions pages/index.res
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ module HeroSection = {
<div className="mt-10 sm:flex sm:justify-center lg:justify-start">
<Button
colors=`text-white bg-orangedark hover:bg-orangedarker`
href=`/resources/installocaml`
href=InternalUrls.resourcesInstallocaml
text=content.installOcaml
margins=``
/>
<Button
colors=`text-orangedark bg-white hover:bg-gray-50`
href=`/industry/whatisocaml`
href=InternalUrls.industryWhatisocaml
text=content.aboutOcaml
margins=`mt-3 sm:mt-0 sm:ml-3`
/>
Expand Down
2 changes: 1 addition & 1 deletion pages/industry/users.res
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let make = (~content=contentEn) => <>
pageDescription=content.pageDescription
callToAction={
TitleHeading.Large.label: "Success Stories",
url: "/industry/successstories",
url: InternalUrls.industrySuccessstories,
}>
<LogoSection margins=`` companies=content.companies />
</Page.Basic>
Expand Down
4 changes: 2 additions & 2 deletions pages/resources/applications.res
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module PlatformTools = {
{s(`The OCaml Platform is a collection of tools that allow programmers to be productive in the OCaml language. It has been an iterative process of refinement as new tools are added and older tools are updated. Different tools accomplish different workflows and are used at different points of a project's life.`)}
</p>
<div className="flex justify-center">
<Link href="/resources/platform">
<Link href=InternalUrls.resourcesPlatform>
<a
className="mt-8 w-full inline-flex items-center justify-center px-8 py-1 border border-transparent text-white text-base font-medium rounded-md bg-orangedark hover:bg-orangedarker sm:w-auto">
{s(`Visit Platform Tools`)}
Expand Down Expand Up @@ -155,7 +155,7 @@ module UsingOcaml = {
</div>
</div>
<p className="text-right font-bold">
<Link href="/resources/usingocaml">
<Link href=InternalUrls.resourcesUsingocaml>
// TODO: descriptive link text
<a className="text-orangedark underline"> {s(content.seeMore ++ ` >`)} </a>
</Link>
Expand Down
4 changes: 2 additions & 2 deletions pages/resources/language.res
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ module Applications = {
{s(`Looking to learn more about the ways in which OCaml is used in real-world applications? Visit our Applications page to find out about different ways of using OCaml.`)}
</p>
<p className="text-right">
<a href="/resources/applications" className="text-orangedark underline">
<a href=InternalUrls.resourcesApplications className="text-orangedark underline">
{s(`Go to Applications >`)}
</a>
</p>
Expand Down Expand Up @@ -196,7 +196,7 @@ module Papers = {
</div>
<div className="flex justify-center">
<a
href="/resources/papers"
href=InternalUrls.resourcesPapers
className="font-bold inline-flex items-center px-10 py-3 border border-transparent text-base leading-4 font-medium rounded-md shadow-sm text-white bg-orangedark hover:bg-orangedarker">
{s(`Go to Papers`)}
</a>
Expand Down