File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -91,3 +91,6 @@ POSTS_PER_PAGE=25
91
91
SITE_DOMAIN = localhost:8080
92
92
LOCALE_FOR_UI = italian
93
93
LOCALE_FOR_GHOST = italian
94
+
95
+ # HASHNODE_DEBUG_MODE_FIRST_PAGE_ONLY=true
96
+ # DO_NOT_FETCH_FROM_GHOST=true
Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ const fetchFromGhost = async endpoint => {
11
11
limit : 200
12
12
} ;
13
13
14
+ if ( process . env . DO_NOT_FETCH_FROM_GHOST ) {
15
+ console . log (
16
+ 'DO_NOT_FETCH_FROM_GHOST is active. This is likely because Ghost is not available for this environment.'
17
+ ) ;
18
+ return [ ] ;
19
+ }
20
+
14
21
while ( currPage && currPage <= lastPage ) {
15
22
const ghostRes = await ghostAPI [ endpoint ]
16
23
. browse ( {
Original file line number Diff line number Diff line change @@ -116,7 +116,15 @@ const fetchFromHashnode = async contentType => {
116
116
) ;
117
117
118
118
after = pageInfo . endCursor ;
119
- hasNextPage = pageInfo . hasNextPage ;
119
+ if ( process . env . HASHNODE_DEBUG_MODE_FIRST_PAGE_ONLY ) {
120
+ console . log (
121
+ 'HASHNODE_DEBUG_MODE_FIRST_PAGE_ONLY is active. Fetching only the first page.'
122
+ ) ;
123
+ }
124
+
125
+ hasNextPage =
126
+ pageInfo . hasNextPage &&
127
+ ! process . env . HASHNODE_DEBUG_MODE_FIRST_PAGE_ONLY ;
120
128
121
129
data . push ( ...resData ) ;
122
130
You can’t perform that action at this time.
0 commit comments