Skip to content

Commit

Permalink
Add a default N_PAGES for the dev build
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-strange committed Aug 1, 2024
1 parent ca80aad commit 21b2081
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/data/areas/place-page/index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ export const layout = "template/areas.vto";
export const tags = ["area"];

const SMALL_SITE = Deno.env.get('SMALL_SITE') !== undefined;
const N_PAGES = Deno.env.get('N_PAGES');
var N_PAGES = Deno.env.get('N_PAGES');
// import { smallSiteAreas } from "../../../../dev.ts";
import smallSiteAreas from "../../../../dev.ts";

export default function* ({areas}) {
if (SMALL_SITE === true) {
if (!N_PAGES) {
N_PAGES=10
}
areas = smallSiteAreas(areas, N_PAGES);
}
for (const [key, value] of Object.entries(areas)){
Expand All @@ -18,8 +21,7 @@ export default function* ({areas}) {
...value,
areas: null, // mask the areas data from other pages.
key: null,
value: null,
test: null,
value: null
};
}
}
Expand Down

0 comments on commit 21b2081

Please sign in to comment.