这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@curbengh
Copy link
Contributor

@curbengh curbengh commented Oct 7, 2018

Upgrade to (as of this PR)

  • jquery 3.3.1
  • clipboard.js 2.0.1
  • fancybox 3.5.2
  • html5shiv 3.7.3

Load following libraries from jsDelivr CDN (which claim to have good coverage in China):

  • jquery
  • clipboard.js
  • fancybox
  • html5shiv
  • gitment
  • valine
  • fontawesome

Some syntax have been modified for compatibility with newer versions,

  • new Clipboard() to new ClipboardJS() for clipboard.js 2.0+
  • fancybox class to data-fancybox attribute and title to data-caption attribute for fancybox 3.0+

SRI attribute is considered, but not implemented because version range is used (instead of a specific version).

I created a github page with these commit https://weyusi.github.io/hexo-testing/

Edit: Reason of not updating fontawesome to v5.

@geekplux
Copy link
Owner

geekplux commented Oct 7, 2018

awesome contribution, LGTM except the scroll arrows of fancybox gallery.

may need following code?

<a data-fancybox="gallery" href="big_1.jpg"><img src="small_1.jpg"></a>

weyusi added 2 commits October 8, 2018 13:27
Add gallery attribute value for fancybox 3 syntax
serve libraries with the latest minor update
@curbengh
Copy link
Contributor Author

curbengh commented Oct 8, 2018

yeah, the data-fancybox attribute needs gallery as value.
jsDelivr also support version range @3 which serves latest version of version 3.
This can help reducing library maintenance, instead of constantly updating the <script src> whenever there is a minor library update.

btw, don't mind the Utterances comment not showing. I'm trying (and failing) to move the library to CDN. This PR still use the original Utterances link.

@geekplux
Copy link
Owner

geekplux commented Oct 8, 2018

I see, great thanks 👍
Now gallery fixed, it works well. So this PR may merge now? or until you finish the migration of Utterances.

@curbengh
Copy link
Contributor Author

curbengh commented Oct 8, 2018

please merge if there is no issue. The migration and testing of Utterances will take a while and probably doesn't work. I'll create another PR if it works.

@geekplux geekplux merged commit 95dbe87 into geekplux:master Oct 8, 2018
@curbengh
Copy link
Contributor Author

curbengh commented Oct 10, 2018

Just in case someone suggest upgrading to fontawesome 5, I don't include it in this PR because it can be confusing to new users (of this theme).
v5 separates the icon styles into 4 (solid and brands are free to use). In v5,
footer.ejs

<li><a href="<%= theme.links[key] %>"><span class="fa fa-<%= key %>"></span></a></li>

only display solid icons, whereas that same line in v4 (currently used in this theme) can display all icons.

To display brand icons, you need fab- prefix,

<li><a href="<%= theme.links[key] %>"><span class="fa fab-<%= key %>"></span></a></li>

But having the above line means fab- also applies on solid icons, which is incorrect in v5.

A possible workaround is to separate the theme.links to solid and brand icons,

<li><a href="<%= theme.links.solid[key] %>"><span class="fa fa-<%= key %>"></span></a></li>
<li><a href="<%= theme.links.brands[key] %>"><span class="fa fab-<%= key %>"></span></a></li>

Otherwise, use only one style. So, keep this in mind if you want to use v5.

@geekplux
Copy link
Owner

@weyusi thanks reminder. Use one style may be better, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants