<% function layoutDiv() { var el = ''; var repo; var branch = 'main'; if (page.layout === 'wiki' && page.wiki) { let proj = theme.wiki.projects[page.wiki]; if (proj && proj.repo) { repo = proj.repo; if (proj.branch !== undefined) { branch = proj.branch; } } } else { // 其它的如果有设置 repo 也可以 repo = page.repo; } if (repo === undefined) { return el; } // 布局 el += '
'; // header el += '
'; el += '' + __("meta.repo_info") + ''; el += '
'; // body el += '
'; var items = []; // GitHub items.push({ icon: '', text: 'GitHub', href: 'https://github.com/' + repo }); // Releases items.push({ icon: '', text: 'Releases', href: 'https://github.com/' + repo + '/releases' }); // Download items.push({ icon: '', text: 'Download', href: 'https://github.com/' + repo + '/archive/refs/heads/' + branch + '.zip' }); // Issues items.push({ icon: '', text: 'Issues', href: 'https://github.com/' + repo + '/issues' }); items.forEach((item, i) => { el += '
'; el += ''; el += ''; }); el += '
'; el += '
'; return el; } %> <%- layoutDiv() %>