Tucker McKnight <tucker@pangolin.lan> | Sun Jul 12 2026
Improve documentation and start making some config fields as optional
108 109 110 111 112 113
return `${refPath(refName, refType)}/commits.xml`
},
homepageButtons: args.reposConfig.repos[args.currentRepoName].defaultTemplateConfiguration?.homepageButtons || []
}
}
108 109 110 111 112 113
return `${refPath(refName, refType)}/commits.xml`
},
homepageButtons: args.reposConfig.repos[args.currentRepoName].defaultTemplate?.homepageButtons || []
}
}
6 7 8 9 10 11
const pageContent = m('div', {class: "container"}, [
m('div', {class: "row my-3"},
m('div', {class: "col"},
m('h1', data.reposConfig.defaultTemplateConfiguration?.allRepositoriesPageTitle || "All Repositories")
)
),
m('div', {class: "row d-flex flex-wrap"},6 7 8 9 10 11
const pageContent = m('div', {class: "container"}, [
m('div', {class: "row my-3"},
m('div', {class: "col"},
m('h1', data.reposConfig.defaultTemplate?.allRepositoriesPageTitle || "All Repositories")
)
),
m('div', {class: "row d-flex flex-wrap"},29 30 31 32 33 34
class: "mx-1 my-2 btn btn-outline-secondary shadow-none dropdown-toggle clone-popover-btn",
'data-copy-text': repo.cloneUrl
}, 'Clone'),
(data.reposConfig.repos[repo.name].defaultTemplateConfiguration?.homepageButtons || []).map((button) => {
return m('a', {
class: "mx-1 my-2 btn btn-outline-secondary shadow-none",
href: button.url,29 30 31 32 33 34
class: "mx-1 my-2 btn btn-outline-secondary shadow-none dropdown-toggle clone-popover-btn",
'data-copy-text': repo.cloneUrl
}, 'Clone'),
(data.reposConfig.repos[repo.name].defaultTemplate?.homepageButtons || []).map((button) => {
return m('a', {
class: "mx-1 my-2 btn btn-outline-secondary shadow-none",
href: button.url,31 32 33 34 35 36
const validator = ajv.compile(ConfigSchema)
const valid = validator(reposConfiguration)
if (!valid) {
throw new Error(validator.errors.map(error => `config object at ${error.instancePath.replaceAll("/", ".")}: ${error.message}`).join("\n"))
}
return async ({directories}) => {31 32 33 34 35 36
const validator = ajv.compile(ConfigSchema)
const valid = validator(reposConfiguration)
if (!valid) {
throw new Error(validator.errors.map(error => `config object at ${error.instancePath.replaceAll("/", ".")}: ${error.message}\n${Object.values(error.params).toString()}`).join("\n"))
}
return async ({directories}) => {5 6 7 8 9
"additionalProperties": false,
"properties": {
"branches": {
"items": {
"anyOf": [
{5 6 7 8 9 10 11
"additionalProperties": false,
"properties": {
"branches": {
"default": "branches: ['**']",
"description": "The list of branches to pull from the source repo, making them available in the public repo. If you have some branches in your source repo (that is, the one specified in `location`,) and you don't want those branches to have a snapshot of their current files available, then do not list those branches in this field. Glob patterns can be used here. By default, pulls all available branches from the source repo.",
"items": {
"anyOf": [
{59 60 61 62 63 64 65 66
"type": "array"
},
"defaultBranch": {
"type": "string"
},
"defaultTemplateConfiguration": {
"additionalProperties": false,
"properties": {
"homepageButtons": {59 60 61 62 63 64 65 66 67 68
"type": "array"
},
"defaultBranch": {
"default": "'main', 'master', or 'develop', determined by looking for one of those branches",
"description": "The default branch for the repository. If this field is not set, Repo Viewer will automatically try `main`, `master`, and `develop`, in that order. Set a `defaultBranch` value if your default branch is not one of those.",
"type": "string"
},
"defaultTemplate": {
"additionalProperties": false,
"properties": {
"homepageButtons": {132 133 134 135 136 137 138 139 140
}
},
"required": [
"location",
"defaultBranch",
"branches",
"tags"
],
"type": "object"
},132 133 134 135 136 137
}
},
"required": [
"location"
],
"type": "object"
},166 167 168 169 170 171 172 173
"description": "An object containing the configuration for your repositories. Each key in this object is a repository name, and the value has several config options for that repository. The required config options describe the path to the repository and which branches should be pulled. See the specific definition of {@link GitConfig } for more details about what goes in these configuration objects."
},
"type": "object"
},
"useDefaultTemplate": {
"type": "boolean"
}
},
"required": [166 167 168 169 170
"description": "An object containing the configuration for your repositories. Each key in this object is a repository name, and the value has several config options for that repository. The required config options describe the path to the repository and which branches should be pulled. See the specific definition of {@link GitConfig } for more details about what goes in these configuration objects."
},
"type": "object"
}
},
"required": [63 64 65 66 67 68
copyFrom: string,
copyTo: string,
}[],
defaultTemplateConfiguration?: {
homepageButtons: Array<{
url: string,
text: string,63 64 65 66 67 68
copyFrom: string,
copyTo: string,
}[],
defaultTemplate?: {
homepageButtons: Array<{
url: string,
text: string,