Skip to content

Commit

Permalink
DN-4: Revalidate never after first build.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jul 15, 2024
1 parent 570205d commit 94a227a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/src/app/dictionaries/biology/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from 'path';
import { Post } from '@components/components/pages/Post';
import {
APPLICATION_DEFAULT_METADATA,
REVALIDATE_STATIC_PAGES,
ROOT_DIR_APP
} from '@components/lib/constants';
import {
Expand All @@ -19,6 +20,8 @@ const dictionary: string = 'biology';
const relDir: string = path.join('dictionaries', dictionary, 'definitions');
const absDir: string = path.join(ROOT_DIR_APP, relDir);

export const revalidate = REVALIDATE_STATIC_PAGES;

export async function generateStaticParams(): Promise<{ slug: string }[]> {
// only pre-render first 3 definitions
const filenames: string[] = fs
Expand Down
3 changes: 3 additions & 0 deletions client/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ export const APPLICATION_DEFAULT_METADATA: PageMetadata = {
};

export const ALPHABET: string[] = 'abcdefghijklmnopqrstuvwxyz#'.split('');

// incremental static regeneration (ISR) in seconds or false
export const REVALIDATE_STATIC_PAGES: boolean | number = false;

0 comments on commit 94a227a

Please sign in to comment.