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

Commit 167743b

Browse files
author
kanishka-work
authored
* define constants for urls and make use of them (#327)
1 parent 7427473 commit 167743b

File tree

7 files changed

+53
-22
lines changed

7 files changed

+53
-22
lines changed

common/GlobalData.res

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ type navContent = {
2929
let navContentEn = {
3030
industrySection: {
3131
header: `Industry`,
32-
whatIsOcaml: {label: `What is OCaml`, url: `/industry/whatisocaml`},
33-
industrialUsers: {label: `Industrial Users`, url: `/industry/users`},
34-
successStories: {label: `Success Stories`, url: `/industry/successstories`},
32+
whatIsOcaml: {label: `What is OCaml`, url: InternalUrls.industryWhatisocaml},
33+
industrialUsers: {label: `Industrial Users`, url: InternalUrls.industryUsers},
34+
successStories: {label: `Success Stories`, url: InternalUrls.industrySuccessstories},
3535
},
3636
resourcesSection: {
3737
header: `Resources`,
38-
releases: {label: `Releases`, url: `/resources/releases`},
39-
applications: {label: `Applications`, url: `/resources/applications`},
40-
language: {label: `Language`, url: `/resources/language`},
41-
archive: {label: `Archive`, url: `/resources/archive`},
38+
releases: {label: `Releases`, url: InternalUrls.resourcesReleases},
39+
applications: {label: `Applications`, url: InternalUrls.resourcesApplications},
40+
language: {label: `Language`, url: InternalUrls.resourcesLanguage},
41+
archive: {label: `Archive`, url: InternalUrls.resourcesArchive},
4242
},
4343
communitySection: {
4444
header: `Community`,
45-
opportunities: {label: `Opportunities`, url: `/community/opportunities`},
46-
news: {label: `News`, url: `/community/news`},
47-
aroundTheWeb: {label: `Around the Web`, url: `/community/aroundweb`},
45+
opportunities: {label: `Opportunities`, url: InternalUrls.communityOpportunities},
46+
news: {label: `News`, url: InternalUrls.communityNews},
47+
aroundTheWeb: {label: `Around the Web`, url: InternalUrls.communityAroundweb},
4848
},
4949
}
5050

@@ -112,15 +112,18 @@ let footerContentEn: Footer.t = {
112112
legalSection: {
113113
header: `Legal`,
114114
entries: [
115-
{label: `Privacy`, url: `/legal/privacy`},
116-
{label: `Terms`, url: `/legal/terms`},
117-
{label: `Carbon Footprint`, url: `/legal/carbonfootprint`},
115+
{label: `Privacy`, url: InternalUrls.legalPrivacy},
116+
{label: `Terms`, url: InternalUrls.legalTerms},
117+
{label: `Carbon Footprint`, url: InternalUrls.legalCarbonfootprint},
118118
],
119119
},
120120
},
121121
sponsorContent: {
122122
thankSponsorPrefix: `Thank you to our`,
123-
hostingProviders: {label: `Hosting Providers`, url: `/legal/carbonfootprint#hostingproviders`},
123+
hostingProviders: {
124+
label: `Hosting Providers`,
125+
url: `${InternalUrls.legalCarbonfootprint}#hostingproviders`,
126+
},
124127
},
125128
}
126129

common/InternalUrls.res

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
let index = "/"
2+
let history = "/history"
3+
let communityAroundweb = "/community/aroundweb"
4+
let communityEvents = "/community/events"
5+
let communityMediaarchive = "/community/mediaarchive"
6+
let communityNews = "/community/news"
7+
let communityNewsarchive = "/community/newsarchive"
8+
let communityOpportunities = "/community/opportunities"
9+
let industrySuccessstories = "/industry/successstories"
10+
let industryUsers = "/industry/users"
11+
let industryWhatisocaml = "/industry/whatisocaml"
12+
let legalCarbonfootprint = "/legal/carbonfootprint"
13+
let legalPrivacy = "/legal/privacy"
14+
let legalTerms = "/legal/terms"
15+
let resourcesBasics = "/resources/basics"
16+
let resourcesInstallocaml = "/resources/installocaml"
17+
let resourcesApplications = "/resources/applications"
18+
let resourcesArchive = "/resources/archive"
19+
let resourcesBestpractices = "/resources/bestpractices"
20+
let resourcesDevelopinginocaml = "/resources/developinginocaml"
21+
let resourcesLanguage = "/resources/language"
22+
let resourcesPapers = "/resources/papers"
23+
let resourcesPapersarchive = "/resources/papersarchive"
24+
let resourcesPlatform = "/resources/platform"
25+
let resourcesReleases = "/resources/releases"
26+
let resourcesUsingocaml = "/resources/usingocaml"

pages/community/news.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ module CategorizedNews = {
221221
</div>
222222
</div>
223223
<div className="text-center">
224-
<a href="/community/newsarchive" className="bg-orangedark text-white px-10 py-3 rounded">
224+
<a
225+
href=InternalUrls.communityNewsarchive
226+
className="bg-orangedark text-white px-10 py-3 rounded">
225227
{s(content.goToNewsArchive)}
226228
</a>
227229
</div>

pages/index.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ module HeroSection = {
5656
<div className="mt-10 sm:flex sm:justify-center lg:justify-start">
5757
<Button
5858
colors=`text-white bg-orangedark hover:bg-orangedarker`
59-
href=`/resources/installocaml`
59+
href=InternalUrls.resourcesInstallocaml
6060
text=content.installOcaml
6161
margins=``
6262
/>
6363
<Button
6464
colors=`text-orangedark bg-white hover:bg-gray-50`
65-
href=`/industry/whatisocaml`
65+
href=InternalUrls.industryWhatisocaml
6666
text=content.aboutOcaml
6767
margins=`mt-3 sm:mt-0 sm:ml-3`
6868
/>

pages/industry/users.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ let make = (~content=contentEn) => <>
111111
pageDescription=content.pageDescription
112112
callToAction={
113113
TitleHeading.Large.label: "Success Stories",
114-
url: "/industry/successstories",
114+
url: InternalUrls.industrySuccessstories,
115115
}>
116116
<LogoSection margins=`` companies=content.companies />
117117
</Page.Basic>

pages/resources/applications.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module PlatformTools = {
8383
{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.`)}
8484
</p>
8585
<div className="flex justify-center">
86-
<Link href="/resources/platform">
86+
<Link href=InternalUrls.resourcesPlatform>
8787
<a
8888
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">
8989
{s(`Visit Platform Tools`)}
@@ -155,7 +155,7 @@ module UsingOcaml = {
155155
</div>
156156
</div>
157157
<p className="text-right font-bold">
158-
<Link href="/resources/usingocaml">
158+
<Link href=InternalUrls.resourcesUsingocaml>
159159
// TODO: descriptive link text
160160
<a className="text-orangedark underline"> {s(content.seeMore ++ ` >`)} </a>
161161
</Link>

pages/resources/language.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ module Applications = {
145145
{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.`)}
146146
</p>
147147
<p className="text-right">
148-
<a href="/resources/applications" className="text-orangedark underline">
148+
<a href=InternalUrls.resourcesApplications className="text-orangedark underline">
149149
{s(`Go to Applications >`)}
150150
</a>
151151
</p>
@@ -196,7 +196,7 @@ module Papers = {
196196
</div>
197197
<div className="flex justify-center">
198198
<a
199-
href="/resources/papers"
199+
href=InternalUrls.resourcesPapers
200200
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">
201201
{s(`Go to Papers`)}
202202
</a>

0 commit comments

Comments
 (0)