[opt] references

This commit is contained in:
xaoxuu 2023-12-20 15:01:46 +08:00
parent 48c9119701
commit d101cfb7b5
1 changed files with 7 additions and 12 deletions

View File

@ -18,18 +18,13 @@ function layoutDiv() {
if (page.references?.length > 0) { if (page.references?.length > 0) {
function refList() { function refList() {
var el = ''; var el = '';
page.references.forEach((item, i) => { for (let ref of page.references) {
el += '<li class="post-title">'; el += `
el += '<a href="' + item.url + '"'; <li class="post-title">
if (item.url.includes('://')) { ${markdown(ref)}
el += ' target="_blank" rel="external nofollow noopener noreferrer">'; </li>
} else { `
el += ' rel="noopener noreferrer">';
} }
el += item.title || item.url;
el += '</a>';
el += '</li>';
});
return el; return el;
} }
el += ` el += `