parent
28854df5bd
commit
b421b47e18
|
@ -1,19 +0,0 @@
|
||||||
# EditorConfig is awesome: http://EditorConfig.org
|
|
||||||
|
|
||||||
# top-most EditorConfig file
|
|
||||||
root = true
|
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file
|
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
# Matches multiple files with brace expansion notation
|
|
||||||
# Set default charset
|
|
||||||
[*.{js,py}]
|
|
||||||
charset = utf-8
|
|
||||||
|
|
||||||
# 4 space indentation
|
|
||||||
[{*.json,*.yml,*.styl,*.ejs}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
46
Gruntfile.js
46
Gruntfile.js
|
@ -1,46 +0,0 @@
|
||||||
module.exports = function(grunt){
|
|
||||||
grunt.initConfig({
|
|
||||||
gitclone: {
|
|
||||||
fontawesome: {
|
|
||||||
options: {
|
|
||||||
repository: 'https://github.com/FortAwesome/Font-Awesome.git',
|
|
||||||
directory: 'tmp/fontawesome'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
fancybox: {
|
|
||||||
options: {
|
|
||||||
repository: 'https://github.com/fancyapps/fancyBox.git',
|
|
||||||
directory: 'tmp/fancybox'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
copy: {
|
|
||||||
fontawesome: {
|
|
||||||
expand: true,
|
|
||||||
cwd: 'tmp/fontawesome/fonts/',
|
|
||||||
src: ['**'],
|
|
||||||
dest: 'source/css/fonts/'
|
|
||||||
},
|
|
||||||
fancybox: {
|
|
||||||
expand: true,
|
|
||||||
cwd: 'tmp/fancybox/source/',
|
|
||||||
src: ['**'],
|
|
||||||
dest: 'source/fancybox/'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_clean: {
|
|
||||||
tmp: ['tmp'],
|
|
||||||
fontawesome: ['source/css/fonts'],
|
|
||||||
fancybox: ['source/fancybox']
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
require('load-grunt-tasks')(grunt);
|
|
||||||
|
|
||||||
grunt.renameTask('clean', '_clean');
|
|
||||||
|
|
||||||
grunt.registerTask('fontawesome', ['gitclone:fontawesome', 'copy:fontawesome', '_clean:tmp']);
|
|
||||||
grunt.registerTask('fancybox', ['gitclone:fancybox', 'copy:fancybox', '_clean:tmp']);
|
|
||||||
grunt.registerTask('default', ['gitclone', 'copy', '_clean:tmp']);
|
|
||||||
grunt.registerTask('clean', ['_clean']);
|
|
||||||
};
|
|
11
package.json
11
package.json
|
@ -1,12 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "hexo-theme-icarus",
|
"name": "hexo-theme-icarus",
|
||||||
"version": "0.0.1",
|
"version": "0.2.0",
|
||||||
"private": true,
|
"private": true
|
||||||
"devDependencies": {
|
|
||||||
"grunt": "~0.4.2",
|
|
||||||
"load-grunt-tasks": "~0.2.0",
|
|
||||||
"grunt-git": "~0.2.2",
|
|
||||||
"grunt-contrib-clean": "~0.5.0",
|
|
||||||
"grunt-contrib-copy": "~0.4.1"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,13 @@
|
||||||
// Caption
|
// Caption
|
||||||
$('.article-entry').each(function(i){
|
$('.article-entry').each(function(i){
|
||||||
$(this).find('img').each(function(){
|
$(this).find('img').each(function(){
|
||||||
if ($(this).parent().hasClass('fancybox')) return;
|
if ($(this).parent().hasClass('fancybox')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var alt = this.alt;
|
var alt = this.alt;
|
||||||
|
if (alt) {
|
||||||
if (alt) $(this).after('<span class="caption">' + alt + '</span>');
|
$(this).after('<span class="caption">' + alt + '</span>');
|
||||||
|
}
|
||||||
|
|
||||||
$(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
|
$(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
|
||||||
});
|
});
|
||||||
|
@ -17,7 +19,6 @@
|
||||||
$(this).attr('rel', 'article' + i);
|
$(this).attr('rel', 'article' + i);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($.fancybox){
|
if ($.fancybox){
|
||||||
$('.fancybox').fancybox();
|
$('.fancybox').fancybox();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +47,7 @@
|
||||||
$('#toTop').css('right', 20);
|
$('#toTop').css('right', 20);
|
||||||
}
|
}
|
||||||
}).on('click', '#toTop', function () {
|
}).on('click', '#toTop', function () {
|
||||||
$(document).scrollTop(0);
|
$('body, html').animate({ scrollTop: 0 }, 600);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
Loading…
Reference in New Issue