Skip to content

Commit 23ff871

Browse files
remove unnecessary provideBlogCategories
1 parent 56246da commit 23ff871

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

apps/site/next-data/providers/blogData.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ function getPosts() {
1313

1414
const posts = getPosts();
1515

16-
export const provideBlogCategories = cache(() => blogData.categories);
17-
1816
export const provideBlogPosts = cache(
1917
(category: BlogCategory): BlogPostsRSC => {
2018
const categoryPosts = posts

apps/site/next.dynamic.constants.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
'use strict';
22

3-
import {
4-
provideBlogCategories,
5-
provideBlogPosts,
6-
} from './next-data/providers/blogData';
3+
import { blogData } from '@/next.json.mjs';
4+
5+
import { provideBlogPosts } from './next-data/providers/blogData';
76
import { BASE_PATH, BASE_URL } from './next.constants.mjs';
87
import { siteConfig } from './next.json.mjs';
98
import { defaultLocale } from './next.locales.mjs';
@@ -31,9 +30,9 @@ export const IGNORED_ROUTES = [
3130
*/
3231
export const DYNAMIC_ROUTES = new Map([
3332
// Provides Routes for all Blog Categories
34-
...provideBlogCategories().map(c => [`blog/${c}`, 'blog-category']),
33+
...blogData.categories.map(c => [`blog/${c}`, 'blog-category']),
3534
// Provides Routes for all Blog Categories w/ Pagination
36-
...provideBlogCategories()
35+
...blogData.categories
3736
// retrieves the amount of pages for each blog category
3837
.map(c => [c, provideBlogPosts(c).pagination.pages])
3938
// creates a numeric array for each page and define a pathname for

0 commit comments

Comments
 (0)