screenshot-api

This commit is contained in:
xaoxuu 2022-10-24 12:48:56 +08:00
parent 4ef9a65cd2
commit f42720e301
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ hexo.extend.tag.register('sites', function(args) {
if (site.url && site.title) {
var cell = '<div class="site-card">';
cell += '<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="' + site.url + '">';
cell += '<img src="' + (site.screenshot || ('https://image.thum.io/get/width/1024/crop/768/' + site.url)) + '" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;' + hexo.theme.config.default.cover + '&quot;;"/>';
cell += '<img src="' + (site.screenshot || ('https://screenshot-api.xaoxuu.com/api?url=' + site.url + '&width=1280&height=720')) + '" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;' + hexo.theme.config.default.cover + '&quot;;"/>';
cell += '<div class="info">';
cell += '<img src="' + (site.avatar || hexo.theme.config.default.link) + '" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;' + hexo.theme.config.default.link + '&quot;;"/>';
cell += '<span class="title">' + site.title + '</span>';

View File

@ -51,7 +51,7 @@ const sitesjs = {
arr.forEach((item, i) => {
var cell = '<div class="site-card">';
cell += '<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="' + item.url + '">';
cell += '<img src="' + (item.screenshot || ('https://image.thum.io/get/width/1024/crop/768/' + item.url)) + '" onerror="javascript:this.src=\'' + cfg.screenshot + '\';"/>';
cell += '<img src="' + (item.screenshot || ('https://screenshot-api.xaoxuu.com/api?url=' + site.url + '&width=1280&height=720')) + '" onerror="javascript:this.src=\'' + cfg.screenshot + '\';"/>';
cell += '<div class="info">';
cell += '<img src="' + (item.avatar || cfg.avatar) + '" onerror="javascript:this.src=\'' + cfg.avatar + '\';"/>';
cell += '<span class="title">' + item.title + '</span>';