mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 19:01:54 +02:00
docs: convert examples to typescript (#3766)
* docs: convert examples to typescript * docs: convert remaining examples * docs: update next.js * ci: fix lint * docs: fix next.js path * docs: cleanup * update Co-authored-by: wendellhu <wendellhu@tencent.com>
This commit is contained in:
11
site/pages/api/index.ts
Normal file
11
site/pages/api/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { readdirSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
|
||||
const examplePath = join(process.cwd(), 'examples')
|
||||
|
||||
export function getAllExamples() {
|
||||
const slugs = readdirSync(examplePath)
|
||||
return slugs
|
||||
.filter(name => name.match(/.tsx$/))
|
||||
.map(n => n.replace(/.tsx$/, ''))
|
||||
}
|
Reference in New Issue
Block a user