diff --git a/Gulpfile.js b/Gulpfile.js index bb6ccde..be99a7c 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -139,6 +139,7 @@ gulp.task('i18n', function() { ls(base + '/blog'); ls(base + '/dist'); ls(base + '/js'); + ls(base + '/album'); ls(base + '/libs'); ls(base + '/member'); ls(base + '/tinymce'); @@ -202,6 +203,39 @@ gulp.task('i18n', function() { }); +// 合并album需要的js +gulp.task('concatAlbumJs', function() { + /* + gulp.src(base + '/album/js/main.js') + .pipe(uglify()) // 压缩 + .pipe(rename({suffix: '.min'})) + .pipe(gulp.dest(base + '/album/js/')); + */ + + gulp.src(base + '/album/css/style.css') + .pipe(rename({suffix: '-min'})) + .pipe(minifycss()) + .pipe(gulp.dest(base + '/album/css')); + + var jss = [ + 'js/jquery-1.9.0.min.js', + 'js/bootstrap-min.js', + 'js/plugins/libs-min/fileupload.js', + 'js/jquery.pagination.js', + 'album/js/main.js', + ]; + + for(var i in jss) { + jss[i] = base + '/' + jss[i]; + } + + return gulp + .src(jss) + .pipe(uglify()) // 压缩 + .pipe(concat('main.all.js')) + .pipe(gulp.dest(base + '/album/js')); +}); + // plugins压缩 gulp.task('plugins', function() { gulp.src(base + '/js/plugins/libs/*.js') @@ -308,4 +342,4 @@ gulp.task('concatCss', function() { gulp.task('concat', ['concatDepJs', 'concatAppJs', 'concatMarkdownJs']); gulp.task('html', ['devToProHtml']); -gulp.task('default', ['concat', 'plugins', 'minifycss', 'i18n', 'html']); +gulp.task('default', ['concat', 'plugins', 'minifycss', 'i18n', 'concatAlbumJs', 'html']); diff --git a/app/init.go b/app/init.go index c295907..0adf5b3 100644 --- a/app/init.go +++ b/app/init.go @@ -180,6 +180,16 @@ func init() { return template.HTML(tagStr) } + // 不用revel的msg + revel.TemplateFuncs["leaMsg"] = func(renderArgs map[string]interface{}, key string) template.HTML { + locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string) + str := revel.Message(locale, key) + if strings.HasPrefix(str, "???") { + str = key + } + return template.HTML(str); + } + // lea++ revel.TemplateFuncs["blogTagsLea"] = func(renderArgs map[string]interface{}, tags []string, typeStr string) template.HTML { if tags == nil || len(tags) == 0 { diff --git a/app/views/note/note.html b/app/views/note/note.html index 0129db1..6c63263 100644 --- a/app/views/note/note.html +++ b/app/views/note/note.html @@ -611,7 +611,7 @@ function log(o) { @@ -691,32 +691,6 @@ function log(o) { - - - @@ -747,7 +721,7 @@ function log(o) { - +