Skip to content

Commit

Permalink
Enabled static page export
Browse files Browse the repository at this point in the history
  • Loading branch information
codeaid committed Apr 28, 2024
1 parent fb0bd26 commit a8f033d
Show file tree
Hide file tree
Showing 7 changed files with 770 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand Down Expand Up @@ -178,7 +175,7 @@ jobs:
- name: Upload assets as artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./out
path: out

# Deployment job
deploy:
Expand Down
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions next.config.mjs → next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const nextConfig = {
assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
distDir: 'out',
output: 'export',
reactStrictMode: true,
swcMinify: true,
trailingSlash: false,
Expand All @@ -17,4 +17,4 @@ const nextConfig = {
}
};

export default nextConfig;
module.exports = nextConfig;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "cotw-tacklebox",
"private": true,
"version": "0.1.0",
"scripts": {
"build": "next build",
Expand Down
5 changes: 5 additions & 0 deletions src/app/fishes/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { notFound } from 'next/navigation';
import { FishInfo } from 'components';
import { fishes } from 'config/fishes';
import { fishIdsGeneric, fishIdsLegendary } from 'types/fishes';

export async function generateStaticParams() {
return [...fishIdsGeneric, ...fishIdsLegendary].map(id => ({ id }));
}

const FishDetailsPage = (props: { params: { id: string } }) => {
const {
Expand Down
167 changes: 86 additions & 81 deletions src/types/fishes.ts
Original file line number Diff line number Diff line change
@@ -1,87 +1,92 @@
import type { ReserveId } from 'types/reserves';

export type FishIdGeneric =
| 'african-mottled-eel'
| 'african-sharptooth-catfish'
| 'african-tigerfish'
| 'alpine-bullhead'
| 'andalusian-barbel'
| 'arctic-char'
| 'asp'
| 'atlantic-salmon'
| 'black-crappie'
| 'blue-kurper'
| 'bluegill'
| 'bream'
| 'brook-trout'
| 'brown-trout-es'
| 'brown-trout-no'
| 'bullhead-catfish'
| 'burbot'
| 'canary-kurper'
| 'channel-catfish'
| 'chub'
| 'comizo-barbel'
| 'common-carp-es'
| 'common-carp-sa'
| 'common-dace'
| 'crucian-carp'
| 'cutthroat-trout'
| 'european-bullhead'
| 'european-eel'
| 'european-perch'
| 'golden-trout'
| 'grass-carp'
| 'grayling'
| 'green-sunfish'
| 'ide'
| 'kokanee-salmon'
| 'lake-trout'
| 'largemouth-bass-es'
| 'largemouth-bass-us'
| 'largemouth-yellowfish'
| 'mirror-carp-es'
| 'mirror-carp-sa'
| 'moggel'
| 'mountain-whitefish'
| 'northern-pike-es'
| 'northern-pike-no'
| 'northern-pike-us'
| 'ohrid-trout'
| 'pumpkinseed'
| 'purple-labeo'
| 'rainbow-trout'
| 'redbreast-kurper'
| 'rednose-labeo'
| 'roach-es'
| 'roach-no'
| 'rudd'
| 'ruffe'
| 'sauger'
| 'shovelnose-sturgeon'
| 'smallmouth-bass-sa'
| 'smallmouth-bass-us'
| 'smallmouth-yellowfish'
| 'spotted-bass'
| 'tench'
| 'thicklip-mullet'
| 'thinlip-mullet'
| 'tiger-muskie'
| 'walleye'
| 'yellow-perch'
| 'zander-es'
| 'zander-no';
export const fishIdsGeneric = [
'african-mottled-eel',
'african-sharptooth-catfish',
'african-tigerfish',
'alpine-bullhead',
'andalusian-barbel',
'arctic-char',
'asp',
'atlantic-salmon',
'black-crappie',
'blue-kurper',
'bluegill',
'bream',
'brook-trout',
'brown-trout-es',
'brown-trout-no',
'bullhead-catfish',
'burbot',
'canary-kurper',
'channel-catfish',
'chub',
'comizo-barbel',
'common-carp-es',
'common-carp-sa',
'common-dace',
'crucian-carp',
'cutthroat-trout',
'european-bullhead',
'european-eel',
'european-perch',
'golden-trout',
'grass-carp',
'grayling',
'green-sunfish',
'ide',
'kokanee-salmon',
'lake-trout',
'largemouth-bass-es',
'largemouth-bass-us',
'largemouth-yellowfish',
'mirror-carp-es',
'mirror-carp-sa',
'moggel',
'mountain-whitefish',
'northern-pike-es',
'northern-pike-no',
'northern-pike-us',
'ohrid-trout',
'pumpkinseed',
'purple-labeo',
'rainbow-trout',
'redbreast-kurper',
'rednose-labeo',
'roach-es',
'roach-no',
'rudd',
'ruffe',
'sauger',
'shovelnose-sturgeon',
'smallmouth-bass-sa',
'smallmouth-bass-us',
'smallmouth-yellowfish',
'spotted-bass',
'tench',
'thicklip-mullet',
'thinlip-mullet',
'tiger-muskie',
'walleye',
'yellow-perch',
'zander-es',
'zander-no',
] as const;

export type FishIdLegendary =
| 'alejandro-magno'
| 'big-larry'
| 'el-matador'
| 'goldstein'
| 'kalle-paul-the-dominator'
| 'la-monstrenca'
| 'sidewinder'
| 'speilfinne'
| 'store-henrik';
export const fishIdsLegendary = [
'alejandro-magno',
'big-larry',
'el-matador',
'goldstein',
'kalle-paul-the-dominator',
'la-monstrenca',
'sidewinder',
'speilfinne',
'store-henrik',
] as const;

export type FishIdGeneric = (typeof fishIdsGeneric)[number];
export type FishIdLegendary = (typeof fishIdsLegendary)[number];

export type FishId = FishIdGeneric | FishIdLegendary;

Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"out/types/**/*.ts"
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit a8f033d

Please sign in to comment.