fix(templates/markdown): support repository (#850) [skip ci]
This commit is contained in:
@@ -505,11 +505,11 @@ metadata.template = async function({__templates, name, plugins}) {
|
|||||||
if (account !== "bypass") {
|
if (account !== "bypass") {
|
||||||
const context = q.repo ? "repository" : account
|
const context = q.repo ? "repository" : account
|
||||||
if ((Array.isArray(this.supports)) && (!this.supports.includes(context)))
|
if ((Array.isArray(this.supports)) && (!this.supports.includes(context)))
|
||||||
throw new Error(`not supported for: ${context}`)
|
throw new Error(`template not supported for: ${context}`)
|
||||||
}
|
}
|
||||||
//Format check
|
//Format check
|
||||||
if ((format) && (Array.isArray(this.formats)) && (!this.formats.includes(format)))
|
if ((format) && (Array.isArray(this.formats)) && (!this.formats.includes(format)))
|
||||||
throw new Error(`not supported for: ${format}`)
|
throw new Error(`template not supported for: ${format}`)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ index: 3
|
|||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
- organization
|
- organization
|
||||||
|
- repository
|
||||||
formats:
|
formats:
|
||||||
- markdown
|
- markdown
|
||||||
- markdown-pdf
|
- markdown-pdf
|
||||||
|
|||||||
Reference in New Issue
Block a user