5 Star 12 Fork 3

Gitee 极速下载/Gatsby

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/gatsbyjs/gatsby
克隆/下载
markdown.config.js 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
const fs = require(`fs-extra`)
const path = require(`path`)
const _ = require(`lodash`)
const exclusionList = [
`gatsby-starter-minimal`,
`gatsby-starter-minimal-ts`,
`gatsby-starter-plugin`,
`gatsby-starter-theme-workspace`,
]
module.exports = {
transforms: {
LIST_STARTERS() {
const base = path.join(process.cwd(), `starters`)
const starters = fs
.readdirSync(base)
.filter(dir => fs.statSync(path.join(base, dir)).isDirectory())
// Filter out excluded starters
.filter(dir => !exclusionList.includes(dir))
.reduce((merged, dir) => {
merged[dir] = JSON.parse(
fs.readFileSync(path.join(base, dir, `package.json`), `utf8`)
)
return merged
}, {})
return `
|Name|Demo|Description|
|:--:|----|-----------|
${Object.keys(starters)
.map(name => {
const starter = starters[name]
return `
|[${name}](https://github.com/gatsbyjs/gatsby-starter-${name})|[gatsby-starter-${name}-demo.netlify.app](https://gatsby-starter-${name}-demo.netlify.app/)|${starter.description}|
`.trim()
})
.join(`\n`)}
`.replace(/^[^|]+/gm, ``)
},
STARTER(content, options, { originalPath }) {
const starter = path.basename(path.dirname(originalPath))
if (exclusionList.includes(starter)) {
return ``
}
const template = fs.readFileSync(
path.join(process.cwd(), `starters`, `README-template.md`),
`utf8`
)
return _.template(template)({
name: starter,
})
},
},
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/Gatsby.git
git@gitee.com:mirrors/Gatsby.git
mirrors
Gatsby
Gatsby
master

搜索帮助