mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-10 05:46:31 +10:00
- fix($core): markdown slot doesn‘t work. (regression of c85f62d)
- docs: fresh Node.JS API.
- test: official plugins.
14 lines
387 B
JavaScript
14 lines
387 B
JavaScript
const { fs, path } = require('@vuepress/shared-utils')
|
|
const getFragment = require('./getFragment')
|
|
|
|
module.exports = function getFragments (dirname, fragmentsDir = 'fragments') {
|
|
const names = fs.readdirSync(path.join(dirname, fragmentsDir))
|
|
return names.map(name => {
|
|
const content = getFragment(dirname, name, fragmentsDir)
|
|
return {
|
|
name,
|
|
content
|
|
}
|
|
})
|
|
}
|