Skip to content

Commit

Permalink
Make separate file for constants
Browse files Browse the repository at this point in the history
And migrate current .env variables that aren't private to exist in this
file
  • Loading branch information
gustavwilliam committed Dec 10, 2024
1 parent da707ca commit d8d77c3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ pnpm-debug.log*
package-lock.json
pnpm-lock.yaml

.astro
.astro
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const DISCORD_INVITE = "https://discord.gg/NsY4AhAtk8"
export const REDBUBBLE_LINK = "https://www.redbubble.com/people/Gurkult/explore"
15 changes: 7 additions & 8 deletions src/navigation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { getPermalink, getBlogPermalink, getHomePermalink, getAsset } from './utils/permalinks';
import { DISCORD_INVITE, REDBUBBLE_LINK } from '~/constants';

export const headerData = {
links: [
links: [
{
text: "Home",
text: 'Home',
href: getHomePermalink(),
},
{
Expand All @@ -20,14 +21,12 @@ export const headerData = {
},
],
actions: [
{ text: "Shop Merch", href: import.meta.env.PUBLIC_REDBUBBLE_LINK, target: '_blank' },
{ text: 'Join Now', href: import.meta.env.PUBLIC_DISCORD_INVITE, target: '_blank', primary: true },
{ text: 'Shop Merch', href: REDBUBBLE_LINK, target: '_blank' },
{ text: 'Join Now', href: DISCORD_INVITE, target: '_blank', primary: true },
],
};

export const footerData = {
socialLinks: [
{ ariaLabel: 'Github', icon: 'tabler:brand-github', href: 'https://github.com/gurkult' },
],
footNote: "",
socialLinks: [{ ariaLabel: 'Github', icon: 'tabler:brand-github', href: 'https://github.com/gurkult' }],
footNote: '',
};
4 changes: 3 additions & 1 deletion src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Stats from '~/components/widgets/Stats.astro';
import Steps2 from '~/components/widgets/Steps2.astro';
import Layout from '~/layouts/PageLayout.astro';
import { DISCORD_INVITE } from '~/constants';
const metadata = {
title: 'About us',
};
Expand Down Expand Up @@ -116,7 +118,7 @@ const metadata = {
subtitle="Seems interesting? We're always looking for new members, and we'd love to have you! Click the link below to get started!"
callToAction={{
text: 'Become a Gurkan',
href: import.meta.env.PUBLIC_DISCORD_INVITE,
href: DISCORD_INVITE,
}}
/>
</Layout>
6 changes: 4 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const metadata = {
title: 'Gurkult - the Gurkan Open Source Community',
ignoreTitleTemplate: true,
};
import { DISCORD_INVITE } from '~/constants';
---

<Layout metadata={metadata}>
Expand All @@ -23,7 +25,7 @@ const metadata = {
{
variant: 'primary',
text: 'Join us',
href: import.meta.env.PUBLIC_DISCORD_INVITE,
href: DISCORD_INVITE,
target: '_blank',
icon: 'tabler:arrow-right',
},
Expand Down Expand Up @@ -196,7 +198,7 @@ const metadata = {
{
variant: 'primary',
text: 'Join now',
href: import.meta.env.PUBLIC_DISCORD_INVITE,
href: DISCORD_INVITE,
},
]}
/>
Expand Down
8 changes: 5 additions & 3 deletions src/pages/pricing.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import CallToAction from '~/components/widgets/CallToAction.astro';
const metadata = {
title: 'Pricing',
};
import { DISCORD_INVITE } from '~/constants';
---

<Layout metadata={metadata}>
Expand Down Expand Up @@ -65,7 +67,7 @@ const metadata = {
callToAction: {
target: '_blank',
text: 'Join now',
href: import.meta.env.PUBLIC_DISCORD_INVITE,
href: DISCORD_INVITE,
},
hasRibbon: true,
ribbonTitle: 'popular',
Expand All @@ -92,7 +94,7 @@ const metadata = {
callToAction: {
target: '_blank',
text: 'Apply now',
href: import.meta.env.PUBLIC_DISCORD_INVITE,
href: DISCORD_INVITE,
},
},
]}
Expand Down Expand Up @@ -215,7 +217,7 @@ const metadata = {
{
variant: 'primary',
text: 'Join now',
href: import.meta.env.PUBLIC_DISCORD_INVITE,
href: DISCORD_INVITE,
},
]}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getRssString } from '@astrojs/rss';

import { SITE, METADATA, APP_BLOG } from '~/utils/config';
import { fetchPosts } from '~/utils/blog';
import { APP_BLOG, METADATA, SITE } from '~/utils/config';
import { getPermalink } from '~/utils/permalinks';

export const GET = async () => {
Expand Down

0 comments on commit d8d77c3

Please sign in to comment.