Skip to content

Commit

Permalink
Fix exturl title
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 1, 2020
1 parent 586b499 commit d9c6d8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ footer:

# Icon between year and copyright info.
icon:
# Icon name in Font Awesome. See: https://fontawesome.com/v4.7.0/icons/
# `heart` is recommended with animation in red (#ff0000).
name: fa fa-user
# Icon name in Font Awesome. See: https://fontawesome.com/icons
name: fa fa-heart
# If you want to animate the icon, set it to true.
animated: false
# Change the color of icon, using Hex Code.
color: "#808080"
color: "#ff0000"

# If not defined, `author` from Hexo `_config.yml` will be used.
copyright:
Expand Down
3 changes: 1 addition & 2 deletions scripts/filters/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ hexo.extend.filter.register('after_post_render', data => {
let link = url.parse(href);
if (!link.protocol || link.hostname === siteHost) return match;

// If title atribute filled, set it as title; if not, set url as title.
return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}" title="${href}">${html}<i class="fa fa-external-link-alt"></i></span>`;
return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}">${html}<i class="fa fa-external-link-alt"></i></span>`;
});
}

Expand Down
1 change: 1 addition & 0 deletions source/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ NexT.utils = {
link.rel = 'noopener external nofollow noreferrer';
link.target = '_blank';
link.className = element.className;
link.title = element.title;
link.innerHTML = element.innerHTML;
element.parentNode.replaceChild(link, element);
});
Expand Down

0 comments on commit d9c6d8b

Please sign in to comment.