File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 - name : Build the docs
4444 run : pnpm build
4545 working-directory : website
46+ env :
47+ NEXT_GHOST_CMS_API_KEY : ${{ secrets.NEXT_GHOST_CMS_API_KEY }}
48+ NEXT_GHOST_CMS_CONTENT_URL : ${{ secrets.NEXT_GHOST_CMS_CONTENT_URL }}
Original file line number Diff line number Diff line change 11export default async function getPosts ( ) {
22 const API_KEY = process . env . NEXT_GHOST_CMS_API_KEY ;
3+ const CONTENT_URL = process . env . NEXT_GHOST_CMS_CONTENT_URL ;
4+
5+ console . log ( { API_KEY , CONTENT_URL } ) ;
6+
7+ if ( ! API_KEY || ! CONTENT_URL ) {
8+ if ( ! process . env . VERCEL_ENV ) {
9+ return [ ] ;
10+ }
11+
12+ throw new Error (
13+ `Please set NEXT_GHOST_CMS_API_KEY and NEXT_GHOST_CMS_CONTENT_URL environment variables`
14+ ) ;
15+ }
16+
317 const endpoint = `${ process . env . NEXT_GHOST_CMS_CONTENT_URL } /posts?key=${ API_KEY } &filter=tag:[hardhat,hardhat-ignition]` ;
418
519 const response = await fetch ( endpoint ) ;
You can’t perform that action at this time.
0 commit comments