Skip to content
Permalink
Browse files

modified for benzblog

  • Loading branch information...
BenZstory committed Jul 10, 2019
1 parent 884155a commit 784beb7424d2693d01728a99c6ab7d061e4db7a2
@@ -1,2 +1,3 @@
* text=auto eol=lf
source/lib/* linguist-vendored
scripts/merge.js linguist-vendored
@@ -1,3 +1,4 @@
.vs
.DS_Store
.idea/
*.log

Large diffs are not rendered by default.

@@ -236,8 +236,21 @@
</span>
{% endif %}

{% if post.tags and post.tags.length and not is_index %}
{% if theme.tag_icon %}
{% set tag_indicate = '<i class="fa fa-tag"></i>' %}
{% else %}
{% set tag_indicate = '#' %}
{% endif %}
<div class="post-tags">
{% for tag in post.tags %}
<a href="{{ url_for(tag.path) }}" rel="tag">{{ tag_indicate }} {{ tag.name }}</a>
{% endfor %}
</div>
{% endif %}

{% if post.description and (not theme.excerpt_description or not is_index) %}
<div class="post-description">{#
<div class="post-description" hidden>{#
#}{{ post.description }}{#
#}</div>
{% endif %}
@@ -352,6 +365,7 @@
{% endif %}

<footer class="post-footer">

{% if post.tags and post.tags.length and not is_index %}
{% if theme.tag_icon %}
{% set tag_indicate = '<i class="fa fa-tag"></i>' %}
@@ -45,7 +45,7 @@
<meta name="baidu-site-verification" content="{{ theme.baidu_site_verification }}"/>
{% endif %}

{% if theme.fancybox %}
{% if theme.fancybox.enable %}
{% set fancybox_css_uri = url_for(theme.vendors._internal + '/fancybox/source/jquery.fancybox.css') %}
{% if theme.vendors.fancybox_css %}
{% set fancybox_css_uri = theme.vendors.fancybox_css %}
@@ -97,7 +97,12 @@
sidebar: {{ theme.sidebar | json_encode }},
back2top: {{ theme.back2top.enable }},
back2top_sidebar: {{ theme.back2top.sidebar }},
fancybox: {{ theme.fancybox }},
fancybox: {
enable: {{theme.fancybox.enable}},
replace_from: {{theme.fancybox.replace_from}},
replace_to: '{{theme.fancybox.replace_to}}',
with_caption: {{theme.fancybox.with_caption}},
},
fastclick: {{ theme.fastclick }},
lazyload: {{ theme.lazyload }},
tabs: {{ theme.tabs.enable }},
@@ -21,7 +21,7 @@
{% set js_vendors.velocity = 'velocity/velocity.min.js?v=1.2.1' %}
{% set js_vendors.velocity_ui = 'velocity/velocity.ui.min.js?v=1.2.1' %}

{% if theme.fancybox %}
{% if theme.fancybox.enable %}
{% set js_vendors.fancybox = 'fancybox/source/jquery.fancybox.pack.js' %}
{% endif %}

@@ -0,0 +1,12 @@
// Custom styles.
.posts-expand .post-body img {
box-sizing: border-box;
margin: 0 auto 0px;
padding: 3px;
border: 1px solid #ddd;
}

.posts-expand .post-meta .post-tags {
margin-top: 10px;
text-align: center;
}
Binary file not shown.
Binary file not shown.
@@ -32,7 +32,7 @@ $(document).ready(function() {
* Register JS handlers by condition option.
* Need to add config option in Front-End at 'layout/_partials/head.swig' file.
*/
CONFIG.fancybox && NexT.utils.wrapImageWithFancyBox();
CONFIG.fancybox.enable && NexT.utils.wrapImageWithFancyBox(CONFIG.fancybox.replace_from, CONFIG.fancybox.replace_to, CONFIG.fancybox.with_caption);
CONFIG.tabs && NexT.utils.registerTabsTag();

NexT.utils.embeddedVideoTransformer();
@@ -5,16 +5,18 @@ NexT.utils = NexT.$u = {
/**
* Wrap images with fancybox support.
*/
wrapImageWithFancyBox: function() {
wrapImageWithFancyBox: function(replace_from, replace_to, with_caption) {
$('.content img')
.not('#qr img')
.not(':hidden')
.each(function() {
var $image = $(this);
var imageTitle = $image.attr('title') || $image.attr('alt');
var $imageWrapLink = $image.parent('a');

if ($imageWrapLink.length < 1) {
var imageLink = $image.attr('data-src') || $image.attr('src');
var imageLink = $image.attr('data-original') || $image.attr('src');
imageLink = imageLink.replace(replace_from, replace_to)

$imageWrapLink = $image.wrap('<a class="fancybox fancybox.image" href="' + imageLink + '" itemscope itemtype="http://schema.org/ImageObject" itemprop="url"></a>').parent('a');
if ($image.is('.post-gallery img')) {
$imageWrapLink.addClass('post-gallery-img');
@@ -28,7 +30,7 @@ NexT.utils = NexT.$u = {
}
}

if (imageTitle) {
if (with_caption && imageTitle) {
$imageWrapLink.append('<p class="image-caption">' + imageTitle + '</p>');
// Make sure img title tag will show correctly in fancybox
$imageWrapLink.attr('title', imageTitle).attr('data-caption', imageTitle);
@@ -46,7 +48,11 @@ NexT.utils = NexT.$u = {
},

lazyLoadPostsImages: function() {
lozad('.content img').observe();
$('#posts').find('img').lazyload({
//placeholder: '/images/loading.gif',
effect : 'fadeIn',
threshold: 0
});
},

/**

0 comments on commit 784beb7

Please sign in to comment.
You can’t perform that action at this time.