diff --git a/scripts/tags/link.js b/scripts/tags/link.js
index 95498ac..7a508fd 100644
--- a/scripts/tags/link.js
+++ b/scripts/tags/link.js
@@ -7,7 +7,6 @@
'use strict';
-var util = require('hexo-util');
const full_url_for = require('hexo-util').full_url_for.bind(hexo);
hexo.extend.tag.register('link', function(args) {
@@ -15,10 +14,11 @@ hexo.extend.tag.register('link', function(args) {
var el = '';
el += '
';
- el += '
';
function loadIcon() {
diff --git a/source/css/_layout/tag-plugins/link.styl b/source/css/_layout/tag-plugins/link.styl
index 293e5ca..f3dc78e 100644
--- a/source/css/_layout/tag-plugins/link.styl
+++ b/source/css/_layout/tag-plugins/link.styl
@@ -3,7 +3,7 @@
margin: 1em auto
display: flex
justify-content: center
- @media screen and (max-width: $device-mobile-425)
+ @media screen and (max-width: $device-mobile-375)
width: 100%
.md .link-card
@@ -14,8 +14,8 @@
cursor: pointer
min-width 280px
max-width: 100%
- width: 350px
- @media screen and (max-width: $device-mobile-425)
+ width: 320px
+ @media screen and (max-width: $device-mobile-375)
width: 100%
box-shadow: $boxshadow-card
border-radius: $border-block
diff --git a/source/js/main.js b/source/js/main.js
index 78c6742..22577e0 100644
--- a/source/js/main.js
+++ b/source/js/main.js
@@ -219,7 +219,7 @@ if (stellar.plugins.stellar) {
let js = stellar.plugins.stellar[key];
if (key == 'linkcard') {
stellar.loadScript(js, { defer: true }).then(function () {
- setCardLink(document.querySelectorAll('a.link-card'));
+ setCardLink(document.querySelectorAll('a.link-card[cardlink]'));
});
} else {
const els = document.getElementsByClassName('stellar-' + key + '-api');
diff --git a/source/js/plugins/linkcard.js b/source/js/plugins/linkcard.js
index 38da2f6..fe1a66c 100644
--- a/source/js/plugins/linkcard.js
+++ b/source/js/plugins/linkcard.js
@@ -27,6 +27,7 @@ function isHttp(url) {
function renderer(el, obj) {
if (obj.title && obj.title.length > 0) {
el.querySelector('.title').innerHTML = obj.title;
+ el.title = obj.title;
}
if (obj.icon && obj.icon.length > 0) {
el.querySelector('.img').style = 'background-image: url("' + obj.icon + '");';