hexo-theme-landscape
hexo-theme-landscape copied to clipboard
add support for social links
This pr add syntax to _config.yaml as follows:
social:
zhihu: https://www.zhihu.com || zhihu
github: https://github.com/somebody || github
twitter: https://twitter.com/somebody || twitter
The key is an identifier for the social link (and what will be shown when mouse hover on the icon), the string before the "||" is the link and the part after is the name of the awesome, the part "igloo" of
<i class="fas fa-igloo">
This syntax is taken from theme next. Ths effect is like: Note the first icon not shown is because firefox/chrome cann't show it, the icon for github and twitter looks fine.
There is already an older version of Fontawesome included in this theme, can't you use it instead of introducing a new one?
Sorry I didn't look closely before creating this pr. I need to be able to write github instead of f09b to use its icon, I don't know if this is possible with otf fonts? By the way feel free to close this pr(although it bothered me when I can't create a social link)
just add the class fa-github to <i>
https://fontawesome.com/v4.7.0/icon/github
The problem is landscape doesn't include needed css file #8
@lijinpei
I like your proposal. Can you rebase?
For fontawesome, can you use v4.7.0? Add the (minified version) css file to "source/css/font", then use the following in <head>
<%- css('css/fonts/font-awesome-4.7.0.min.js') %>
instead of <link rel="stylesheet">
.
There is already an older version of Fontawesome included in this theme, can't you use it instead of introducing a new one?
The css version lets the user refer to a icon by name, the "font file" version can only be referred to by unicode.
I haven't test it, so far I can verify that https://github.com/hexojs/hexo-theme-landscape/blob/d43a9ef40ac0c7c1ed1ef1f188fff7dcce62ae65/source/css/fonts/font-awesome-4.7.0.min.css corresponds to https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
I haven't test it, so far I can verify that https://github.com/hexojs/hexo-theme-landscape/blob/d43a9ef40ac0c7c1ed1ef1f188fff7dcce62ae65/source/css/fonts/font-awesome-4.7.0.min.css corresponds to https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
I download the file from fontawesome's website, it should be the same with the cdn's version. Maybe we can deplot it from some cdn link, or upgrade to fontawesome 5 ? Fontawesome 5 support more icons than fa 4.
We need to verify that the library has not been modified (by the committer).
We prefer to self-host; I'm aware we still use jsdelivr, we are (slowly) moving to self-host.
font-awesome 5 is clunky to integrate, i.e. fa-
is separated into fas-
and fab-
.
social:
zhihu: https://www.zhihu.com || zhihu
github: https://github.com/somebody || github
twitter: https://twitter.com/somebody || twitter
why not just derive icon name from the object key, instead of using ||
, like this.
please document the feature in readme and _config.yml.
👍
Hi, Is it mergeable? I'd like to see this feature 👍
Superseded by https://github.com/hexojs/hexo-theme-landscape/pull/177
Thanks for your contribution!