-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reclassify source directories according to module purpose
- Loading branch information
1 parent
c3e4f42
commit bf78cc0
Showing
20 changed files
with
70 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
scripts/generate-meta-cache.ts → scripts/generate-cache.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use server' | ||
|
||
import { type ListFolder } from '@/config/content-config' | ||
import { type Locale } from '@/config/locale-config' | ||
import { type MetaCacheItem, type MetaCacheMapKey } from '@/config/cache-config' | ||
import article_en from './article-en.json' | ||
import article_zh from './article-zh.json' | ||
import cookbook_zh from './cookbook-zh.json' | ||
|
||
const metaCacheMap = new Map<MetaCacheMapKey, MetaCacheItem[]>([ | ||
['article_en', article_en as MetaCacheItem[]], | ||
['article_zh', article_zh as MetaCacheItem[]], | ||
['cookbook_zh', cookbook_zh as MetaCacheItem[]], | ||
]) | ||
|
||
export const getMetaCache = async ( | ||
folder: ListFolder, | ||
locale: Locale, | ||
): Promise<MetaCacheItem[]> => { | ||
const cache = metaCacheMap.get(`${folder}_${locale}`) | ||
return cache || [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { type ContentItem, type ListFolder } from './content-config' | ||
import { type Locale } from './locale-config' | ||
|
||
export const cacheRootFolder = 'cache' | ||
|
||
export const metaCacheRootFolder = 'meta-cache' | ||
|
||
export type MetaCacheMapKey = `${ListFolder}_${Locale}` | ||
|
||
export type MetaCacheItem = Pick<ContentItem, 'slug' | 'metadata'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.