-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes and enhancements. [11] #1649
Conversation
@@ -14,7 +14,8 @@ NexT.utils = NexT.$u = { | |||
var $imageWrapLink = $image.parent('a'); | |||
|
|||
if ($imageWrapLink.size() < 1) { | |||
$imageWrapLink = $image.wrap('<a href="' + this.getAttribute('src') + '"></a>').parent('a'); | |||
var imageLink = ($image.attr('data-original')) ? this.getAttribute('data-original') : this.getAttribute('src'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
alt = alt.trim(); | ||
title = title.trim(); | ||
|
||
var image = ['<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject"><img itemprop="url image" src="/images/loading.gif" data-original="' + src + '" class="full-image"']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
@@ -14,7 +14,8 @@ NexT.utils = NexT.$u = { | |||
var $imageWrapLink = $image.parent('a'); | |||
|
|||
if ($imageWrapLink.size() < 1) { | |||
$imageWrapLink = $image.wrap('<a href="' + this.getAttribute('src') + '"></a>').parent('a'); | |||
var imageLink = ($image.attr('data-original')) ? this.getAttribute('data-original') : this.getAttribute('src'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
alt = alt.trim(); | ||
title = title.trim(); | ||
|
||
var image = ['<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject"><img itemprop="url image" src="/images/loading.gif" data-original="' + src + '" class="full-image"']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Lazy load images are now supported by |
PART 1. Some small fixes & enhancements.
Files modified:
What's this?
PART 2. Option for separated meta in post-wordcount.
This will add switch option to replace wordcount information block on new line or not. (#1613)
Files modified:
How it looks?
How to use?
In Next
_config.yml
:If
true
wordcount block will placed in new line. Default.If
false
wordcount block will added in main meta-block at the right of the time, category, comments blocks, etc.PART 3. Option for placed new words in new line in TOC.
If header of nav item in TOC is much long, all words will placed in new lines. It's like
\r\n
.Files modified:
How it looks?
How to use?
In Next
_config.yml
:PART 4. Lazy load images.
Return and remake lazy load images function for all images types.
Files modified:
Need to modify manually for now (28.05.2017):
P.S. Already pulled in hexo, mb will merged.
How it looks?
U can see live demo in this post. Just refresh browser with CTRL+SHIFT+R.
How to use?
To use with full-image (main post image) need to write something like that:
li (lazy-image) tag will appear instead of fi (full image) tag, with lazy loading on all pages (include homepage too).
Another words:
if u write fi — image will load instantly;
if u write li — image will load lazy (when will need to see this image).
To use with img tag (simply post images) need to write something like that:
Image class = lazy. If image haven't class lazy, then image will load as is, in standart loading.
Attention!
This function worked fine, but there is 1 bad thing: SEO.
If image will load lazy, original image source will no index by search engines. Because, default image src will loading gif file and original image will load after javascript working. So, if u use own original images and u need to index this images like google images and other services, this function of lazy loading images will not allow to do this.
PART 5. Star rating support.
Enable 5 stars rating widget to each article.
Files modified:
How it looks?
How to use?
In Next
_config.yml
: