social button title

This commit is contained in:
xaoxuu 2021-06-23 16:39:21 +08:00
parent 25ce0c00e1
commit 910bfbeecd
2 changed files with 11 additions and 4 deletions

View File

@ -105,13 +105,17 @@ comments:
######## Footer ######## ######## Footer ########
footer: footer:
social: social:
# - icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/25678f144c438.svg"/>' # - title: RSS
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/25678f144c438.svg"/>'
# url: /atom.xml # url: /atom.xml
# - icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/08a41b181ce68.svg"/>' # - title: GitHub
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/08a41b181ce68.svg"/>'
# url: / # url: /
# - icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/cf1ae151f9e83.svg"/>' # - title: Music
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/cf1ae151f9e83.svg"/>'
# url: / # url: /
# - icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/942ebbf1a4b91.svg"/>' # - title: Comments
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/942ebbf1a4b91.svg"/>'
# url: / # url: /
license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)' license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)' source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)'

View File

@ -15,6 +15,9 @@ function layoutFooterDiv() {
theme.footer.social.forEach(item => { theme.footer.social.forEach(item => {
if (item.icon && (item.url || item.onclick)) { if (item.icon && (item.url || item.onclick)) {
el += '<a class="social"'; el += '<a class="social"';
if (item.title) {
el += ' title="' + item.title + '"';
}
if (item.url) { if (item.url) {
el += ' href="' + url_for(item.url) + '"'; el += ' href="' + url_for(item.url) + '"';
if (item.url.includes('://')) { if (item.url.includes('://')) {