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