[feat] override repo in front-matter

This commit is contained in:
xaoxuu 2022-11-22 22:38:25 +08:00
parent 6f48c3f477
commit fca4425122
2 changed files with 6 additions and 8 deletions

View File

@ -3,7 +3,9 @@ function layoutDiv() {
var el = '';
var repo;
var branch = 'main';
if (page.layout === 'wiki' && page.wiki) {
if (page.repo) {
repo = page.repo
} else if (page.layout === 'wiki' && page.wiki) {
let proj = theme.wiki.projects[page.wiki];
if (proj && proj.repo) {
repo = proj.repo;
@ -11,9 +13,6 @@ function layoutDiv() {
branch = proj.branch;
}
}
} else {
// 其它的如果有设置 repo 也可以
repo = page.repo;
}
if (repo == undefined) {
return el;

View File

@ -3,7 +3,9 @@ function layoutDiv() {
var el = '';
var repo;
var branch = 'main';
if (page.layout === 'wiki' && page.wiki) {
if (page.repo) {
repo = page.repo
} else if (page.layout === 'wiki' && page.wiki) {
let proj = theme.wiki.projects[page.wiki];
if (proj && proj.repo) {
repo = proj.repo;
@ -11,9 +13,6 @@ function layoutDiv() {
branch = proj.branch;
}
}
} else {
// 其它的如果有设置 repo 也可以
repo = page.repo;
}
if (repo == undefined) {
return el;