Skip to content

Commit

Permalink
Add link to free music pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticflute authored Oct 21, 2024
1 parent 0c36460 commit f2c1656
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`footer renders the expected set of links 1`] = `
"http://localhost/about",
"http://localhost/#portfolio",
"http://localhost/contact",
"https://nathan-david-mcwilliams.ck.page/free-music-pack",
"https://soundcloud.com/nathan_david_mcwilliams",
"https://www.youtube.com/@nathandavidmcwilliams",
"https://mysticflute.itch.io/",
Expand Down
4 changes: 2 additions & 2 deletions app/_components/nav/__tests__/links.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect } from '@jest/globals';
import { mainNavigation, allSocialLinks } from '../links';

const SITE_LINK = /^\/.*/;
const SITE_LINK = /(^\/.*)|^https:\/\/.+/;
const SECURE_LINK = /^https:\/\/.+/;

describe('links', () => {
Expand All @@ -14,7 +14,7 @@ describe('links', () => {
});

it.each(mainNavigation)(
'$label should be a valid link beginning with "/"',
'$label should be a valid link beginning with "/" or "https://"',
link => {
expect(link.path).toMatch(SITE_LINK);
},
Expand Down
4 changes: 3 additions & 1 deletion app/_components/nav/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ export type SocialLink = Link & {
readonly url: string;
};

const kitBase = 'https://nathan-david-mcwilliams.ck.page';

/** Main internal pages. */
export const mainNavigation: readonly InternalLink[] = [
{ key: 'home', label: 'Home', path: '/' },
{ key: 'about', label: 'About', path: '/about' },
{ key: 'portfolio', label: 'Portfolio', path: '/#portfolio' },
{ key: 'contact', label: 'Contact', path: '/contact' },
// { key: 'free', label: 'Free Pack', path: '/free-pack' },
{ key: 'free', label: 'Free Pack', path: `${kitBase}/free-music-pack` },
];

/** The Twitter social media account. */
Expand Down

0 comments on commit f2c1656

Please sign in to comment.