-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit brings the following changes: - Adds proper seo handling - Adds pink & salmon custom color palettes to tailwind. - Adds construct metadata utility function. - Enables react strict mode and disables eslint & typescript checks in next config. - Adds favicon, thumbnail images.
- Loading branch information
Showing
20 changed files
with
304 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ ignorePaths: | |
- drizzle | ||
- '**/*.svg' | ||
- .vscode/extensions.json | ||
- public | ||
words: | ||
- clsx | ||
- commitlint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<browserconfig> | ||
<msapplication> | ||
<tile> | ||
<square150x150logo src="/mstile-150x150.png"/> | ||
<TileColor>#111111</TileColor> | ||
</tile> | ||
</msapplication> | ||
</browserconfig> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { MetadataRoute } from 'next'; | ||
|
||
import { constants } from '@/constants'; | ||
|
||
/** | ||
* This function returns an object that represents the manifest.json file which | ||
* next.js uses to create the manifest.json file. | ||
* | ||
* @returns The manifest.json file configuration. | ||
*/ | ||
export default function manifest(): MetadataRoute.Manifest { | ||
return { | ||
name: constants.name, | ||
short_name: constants.shortName, | ||
description: constants.description, | ||
start_url: '/', | ||
display: 'standalone', | ||
background_color: '#111111', | ||
theme_color: '#F86C6A', | ||
icons: [ | ||
{ | ||
src: '/android-chrome-192x192.png', | ||
sizes: '192x192', | ||
type: 'image/png', | ||
purpose: 'maskable', | ||
}, | ||
{ | ||
src: '/android-chrome-512x512.png', | ||
sizes: '512x512', | ||
type: 'image/png', | ||
purpose: 'maskable', | ||
}, | ||
], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { MetadataRoute } from 'next'; | ||
|
||
import { getBaseUrl } from '@/lib/utils'; | ||
|
||
/** | ||
* This function returns an object that represents the robots.txt file which | ||
* next.js uses to create the robots.txt file. | ||
* | ||
* @returns The robots.txt file configuration. | ||
*/ | ||
export default function robots(): MetadataRoute.Robots { | ||
return { | ||
rules: { | ||
userAgent: '*', | ||
allow: '/', | ||
}, | ||
sitemap: `${getBaseUrl()}/sitemap.xml`, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const constants = { | ||
name: 'Noodle - Rethinking Student Productivity', | ||
shortName: 'Noodle', | ||
tagline: 'Rethinking Student Productivity', | ||
description: | ||
'Noodle is a productivity platform including many tools students need to be productive and stay on top of their work such as note taking, task management, and more.', | ||
twitter_handle: '@noodle_run', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,50 @@ | ||
import { describe, expect, it } from 'bun:test'; | ||
import { afterEach, describe, expect, it } from 'bun:test'; | ||
|
||
import { cn } from './utils'; | ||
import { cn, constructMetadata, getBaseUrl } from './utils'; | ||
|
||
describe('utils', () => { | ||
const originalWindow = window; | ||
|
||
afterEach(() => { | ||
window = originalWindow; | ||
}); | ||
|
||
it('should merge classes using cn function', () => { | ||
const classes = cn('text-black p-4', 'text-white'); | ||
|
||
expect(classes).toBe('p-4 text-white'); | ||
}); | ||
|
||
it('should get the base URL', () => { | ||
Object.defineProperty(window, 'location', { | ||
value: new URL('http://example.com'), | ||
configurable: true, | ||
}); | ||
|
||
expect(getBaseUrl()).toBe('http://example.com'); | ||
}); | ||
|
||
it('should get the base vercel url when available', () => { | ||
// @ts-expect-error window needs to be undefined | ||
window = undefined; | ||
|
||
process.env['VERCEL_URL'] = 'example.com'; | ||
|
||
expect(getBaseUrl()).toBe('https://example.com'); | ||
}); | ||
|
||
it('should construct metadata', () => { | ||
Object.defineProperty(window, 'location', { | ||
value: new URL('http://example.com'), | ||
configurable: true, | ||
}); | ||
|
||
const metadata = constructMetadata({ | ||
title: 'hello', | ||
description: 'world', | ||
}); | ||
|
||
expect(metadata.title).toBe('hello'); | ||
expect(metadata.description).toBe('world'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.