diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-10-22 22:51:50 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-10-22 22:51:50 +0300 |
commit | 0ed6bf41be126e8a4f274de06545dbf4f3f883c2 (patch) | |
tree | 879eab5d2faf28f42ed30bc012a90c58229b55b9 /src/lib | |
parent | 31b71bc0dc377b6a3f578188f2d3ee25cfe2e935 (diff) | |
download | benzin-next-0ed6bf41be126e8a4f274de06545dbf4f3f883c2.tar.gz |
feat: support syntax highlighting
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/nginxAdapter.ts | 4 | ||||
-rw-r--r-- | src/lib/types.ts | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/nginxAdapter.ts b/src/lib/nginxAdapter.ts index fdadd87..be39022 100644 --- a/src/lib/nginxAdapter.ts +++ b/src/lib/nginxAdapter.ts @@ -41,9 +41,9 @@ const nginxAdapter: Adapter = { return markdownSource; }, - async getEmojiFileNames(cdn) { + async getEmojiFileNames(cdn, emojiRootPath) { const urls = await memoizedDeepListNginxDirectory(cdn); - return _.compact(urls.map((s: string) => s.match(/emoji\/(.*)/)?.[1])); + return _.compact(urls.map((s: string) => s.match(`${emojiRootPath}\/(.*)`)?.[1])); }, } diff --git a/src/lib/types.ts b/src/lib/types.ts index da073e6..2070e0b 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -4,7 +4,7 @@ import { GetStaticPathsResult } from 'next'; export interface Adapter { getStaticMarkdownPaths: (cdn: string) => Promise<GetStaticPathsResult['paths']>; getMarkdownSource: (cdn: string, path: string[]) => Promise<string>; - getEmojiFileNames: (cdn: string) => Promise<string[]>; + getEmojiFileNames: (cdn: string, emojiRootPath: string) => Promise<string[]>; } export interface BenzinConfig { @@ -12,4 +12,5 @@ export interface BenzinConfig { adapter: Adapter; title: string; faviconPath: string; + emojiRootPath: string; } |