Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
智布道
OneBlog
提交
cba4c509
O
OneBlog
项目概览
智布道
/
OneBlog
9 个月 前同步成功
通知
11
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OneBlog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cba4c509
编写于
7月 20, 2018
作者:
Y
yadong.zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
集成YUI compressor实现js、css文件的自动压缩
上级
136ec907
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
208 addition
and
5176 deletion
+208
-5176
.gitignore
.gitignore
+0
-1
README.md
README.md
+1
-1
blog-admin/pom.xml
blog-admin/pom.xml
+57
-0
blog-admin/src/main/java/com/zyd/blog/core/config/ShiroConfig.java
...n/src/main/java/com/zyd/blog/core/config/ShiroConfig.java
+1
-1
blog-admin/src/main/resources/static/assets/js/zhyd.publish-article.js
...c/main/resources/static/assets/js/zhyd.publish-article.js
+8
-7
blog-web/pom.xml
blog-web/pom.xml
+53
-0
blog-web/src/main/resources/static/js/wangEditor.min.js
blog-web/src/main/resources/static/js/wangEditor.min.js
+0
-4689
blog-web/src/main/resources/static/js/zhyd.comment.js.back
blog-web/src/main/resources/static/js/zhyd.comment.js.back
+0
-475
blog-web/src/main/resources/templates/layout/footer.ftl
blog-web/src/main/resources/templates/layout/footer.ftl
+1
-2
docs/yuicompressor/gzjs.sh
docs/yuicompressor/gzjs.sh
+87
-0
docs/yuicompressor/yuicompressor-2.4.8.jar
docs/yuicompressor/yuicompressor-2.4.8.jar
+0
-0
未找到文件。
.gitignore
浏览文件 @
cba4c509
...
...
@@ -11,7 +11,6 @@
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
...
...
README.md
浏览文件 @
cba4c509
...
...
@@ -81,7 +81,7 @@ ps: 虽然我知道,大部分人都是来了**直接下载源代码**后就潇
1.
数据库链接属性(在
`resources/application-{env}.yml`
配置文件中搜索
`datasource`
或定位到L.7)
2.
redis配置(在
`resources/application.yml`
配置文件中搜索
`redis`
或定位到L.65)
3.
mail配置(在
`resources/application-{env}.yml`
配置文件中搜索
`mail`
或定位到L.14)
4.
【
[
七牛云
](
http
://qiniu.com
)
】配置(见sys_config表中qiniu_
*
开头的字段)
4.
【
[
七牛云
](
http
s://portal.qiniu.com/signup?code=3l8yx2v0f21ci
)
】配置(见sys_config表中qiniu_
*
开头的字段)
注:因为系统存在redis缓存,如果是第一次使用,可以直接修改sys_config表内容,如果不是第一次用,建议使用admin项目中的
`系统配置`
页面修改相关配置内容
5.
运行项目(三种方式)
1.
项目根目录下执行
`mvn -X clean package -Dmaven.test.skip=true -Ptest`
编译打包(注:-Ptest中的test为环境标识),然后cd到blog-web目录下执行
`java -jar target/blog-web.jar`
...
...
blog-admin/pom.xml
浏览文件 @
cba4c509
...
...
@@ -41,6 +41,46 @@
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>-->
<plugin>
<groupId>
net.alchim31.maven
</groupId>
<artifactId>
yuicompressor-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
compress
</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- 读取js,css文件采用UTF-8编码 -->
<encoding>
UTF-8
</encoding>
<!-- 不显示js可能的错误 -->
<jswarn>
false
</jswarn>
<!-- 若存在已压缩的文件,会先对比源文件是否有改动 有改动便压缩,无改动就不压缩 -->
<force>
false
</force>
<!-- 在指定的列号后插入新行 -->
<linebreakpos>
-1
</linebreakpos>
<!-- 压缩之前先执行聚合文件操作 -->
<preProcessAggregates>
true
</preProcessAggregates>
<!-- 压缩后保存的文件后缀:true=无后缀 ,false=有后缀-min -->
<nosuffix>
true
</nosuffix>
<!-- 源目录,即需压缩的根目录 -->
<sourceDirectory>
src/main/resources/static/assets
</sourceDirectory>
<!-- 目标输出目录 -->
<outputDirectory>
target/classes/static/assets
</outputDirectory>
<!-- 压缩js和css文件 -->
<includes>
<include>
**/*.js
</include>
<include>
**/*.css
</include>
</includes>
<!-- 以下目录和文件不会被压缩 -->
<excludes>
<exclude>
**/*.min.js
</exclude>
<exclude>
**/*.min.css
</exclude>
<exclude>
**/jquery-form.js
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
...
...
@@ -52,6 +92,23 @@
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<filtering>
true
</filtering>
<directory>
src/main/resources
</directory>
<includes>
<include>
static/assets/images/**
</include>
<!--<include>%regex[static/assets/js/(jquery-form|wangEditor\.min)\.js]</include>-->
<include>
static/assets/js/jquery-form.js
</include>
<include>
static/assets/js/wangEditor.min.js
</include>
<include>
static/assets/css/jquery-confirm.min.css
</include>
<include>
templates/**
</include>
<include>
*.yml
</include>
<include>
*.txt
</include>
<include>
*.xml
</include>
</includes>
</resource>
</resources>
</build>
...
...
blog-admin/src/main/java/com/zyd/blog/core/config/ShiroConfig.java
浏览文件 @
cba4c509
...
...
@@ -227,7 +227,7 @@ public class ShiroConfig {
// 这个参数是cookie的名称,对应前端的checkbox的name = rememberMe
SimpleCookie
simpleCookie
=
new
SimpleCookie
(
"rememberMe"
);
// 记住我cookie生效时间30天 ,单位秒。 注释掉,默认永久不过期 2018-07-15
//
simpleCookie.setMaxAge(redisProperties.getExpire());
simpleCookie
.
setMaxAge
(
redisProperties
.
getExpire
());
return
simpleCookie
;
}
...
...
blog-admin/src/main/resources/static/assets/js/zhyd.publish-article.js
浏览文件 @
cba4c509
...
...
@@ -92,17 +92,18 @@ if(articleId){
if
(
info
[
'
coverImage
'
]){
$
(
"
.coverImage
"
).
attr
(
'
src
'
,
appConfig
.
qiniuPath
+
info
[
'
coverImage
'
]);
}
if
(
info
[
'
contentMd
'
]){
$
(
"
#contentMd
"
).
val
(
info
[
'
contentMd
'
]);
var
contentMd
=
info
[
'
contentMd
'
];
if
(
contentMd
){
$
(
"
#contentMd
"
).
val
(
contentMd
);
if
(
simplemde
){
simplemde
.
value
(
info
[
'
contentMd
'
]
);
simplemde
.
value
(
contentMd
);
}
}
if
(
info
[
'
content
'
]
){
$
(
"
#content
"
).
val
(
info
[
'
content
'
]
);
var
contentHtml
=
info
[
'
content
'
];
if
(
contentHtml
){
$
(
"
#content
"
).
val
(
contentHtml
);
if
(
editor
){
editor
.
txt
.
html
(
info
[
'
content
'
]
);
editor
.
txt
.
html
(
contentHtml
);
}
}
$publishForm
.
find
(
"
input[type!=checkbox], select, textarea
"
).
each
(
function
()
{
...
...
blog-web/pom.xml
浏览文件 @
cba4c509
...
...
@@ -39,6 +39,45 @@
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>-->
<plugin>
<groupId>
net.alchim31.maven
</groupId>
<artifactId>
yuicompressor-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
compress
</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- 读取js,css文件采用UTF-8编码 -->
<encoding>
UTF-8
</encoding>
<!-- 不显示js可能的错误 -->
<jswarn>
false
</jswarn>
<!-- 若存在已压缩的文件,会先对比源文件是否有改动 有改动便压缩,无改动就不压缩 -->
<force>
false
</force>
<!-- 在指定的列号后插入新行 -->
<linebreakpos>
-1
</linebreakpos>
<!-- 压缩之前先执行聚合文件操作 -->
<preProcessAggregates>
true
</preProcessAggregates>
<!-- 压缩后保存的文件后缀:true=无后缀 ,false=有后缀-min -->
<nosuffix>
true
</nosuffix>
<!-- 源目录,即需压缩的根目录 -->
<sourceDirectory>
src/main/resources/static
</sourceDirectory>
<!-- 目标输出目录 -->
<outputDirectory>
target/classes/static
</outputDirectory>
<!-- 压缩js和css文件 -->
<includes>
<include>
**/*.js
</include>
<include>
**/*.css
</include>
</includes>
<!-- 以下目录和文件不会被压缩 -->
<excludes>
<exclude>
**/*.min.js
</exclude>
<exclude>
**/*.min.css
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
...
...
@@ -50,6 +89,20 @@
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<filtering>
true
</filtering>
<directory>
src/main/resources
</directory>
<!-- includes和excludes冲突时,以excludes为准 -->
<includes>
<include>
templates/**
</include>
<include>
static/img/**
</include>
<include>
*.yml
</include>
<include>
*.txt
</include>
<include>
*.xml
</include>
</includes>
</resource>
</resources>
</build>
...
...
blog-web/src/main/resources/static/js/wangEditor.min.js
已删除
100644 → 0
浏览文件 @
136ec907
此差异已折叠。
点击以展开。
blog-web/src/main/resources/static/js/zhyd.comment.js.back
已删除
100644 → 0
浏览文件 @
136ec907
此差异已折叠。
点击以展开。
blog-web/src/main/resources/templates/layout/footer.ftl
浏览文件 @
cba4c509
...
...
@@ -142,7 +142,7 @@
</div>
<footer class="footer">
<div class="clear">
<p>托管于<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=wylo59db" target="_blank" title="阿里云-为了无法计算的价值" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">阿里云</a> & <a href="https://
www.qiniu.com/
" target="_blank" title="七牛云-国内领先的企业级云服务商" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">七牛云</a> · <a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action" target="_blank" title="查看备案信息" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">鲁ICP备17054970号-1</a></p>
<p>托管于<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=wylo59db" target="_blank" title="阿里云-为了无法计算的价值" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">阿里云</a> & <a href="https://
portal.qiniu.com/signup?code=3l8yx2v0f21ci
" target="_blank" title="七牛云-国内领先的企业级云服务商" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">七牛云</a> · <a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action" target="_blank" title="查看备案信息" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">鲁ICP备17054970号-1</a></p>
<p>Copyright©2016-${.now?string("yyyy")} ${config.siteName} · Powered by <a href="https://gitee.com/yadong.zhang/DBlog" title="DBlog是一款简洁美观、自适应的Java博客系统..." data-toggle="tooltip" data-placement="right" target="_blank"><strong>DBlog</strong></a> · <a href="http://tongji.baidu.com/web/welcome/ico?s=590226d2f4ffbf051442eb75f37333c9" target="_blank" title="点击查看${config.siteName}网站统计详情" data-toggle="tooltip" data-placement="right" rel="external nofollow"><i class="fa fa-bar-chart-o fa-fw fa-spin"></i>网站统计</a></p>
</div>
</footer>
...
...
@@ -166,7 +166,6 @@
zfbPraiseCode: '${config.zfbPraiseCode}'
}
</script>
<script type="text/javascript" src="${config.staticWebSite}/js/wangEditor.min.js"></script>
<script type="text/javascript" src="${config.staticWebSite}/js/zhyd.core.js"></script>
<script type="text/javascript" src="${config.staticWebSite}/js/zhyd.js"></script>
<script type="text/javascript" src="${config.staticWebSite}/js/zhyd.comment.js"></script>
\ No newline at end of file
docs/yuicompressor/gzjs.sh
0 → 100644
浏览文件 @
cba4c509
# http://yui.github.io/yuicompressor/
#
# java -jar yuicompressor-x.y.z.jar
# Usage: java -jar yuicompressor-x.y.z.jar [options] [input file]
#
# Global Options
# -h, --help Displays this information
# --type <js|css> Specifies the type of the input file
# --charset <charset> Read the input file using <charset>
# --line-break <column> Insert a line break after the specified column number
# -v, --verbose Display informational messages and warnings
# -o <file> Place the output into <file> or a file pattern.
# Defaults to stdout.
#
# JavaScript Options
# --nomunge Minify only, do not obfuscate
# --preserve-semi Preserve all semicolons
# --disable-optimizations Disable all micro optimizations
#
# GLOBAL OPTIONS
#
# -h, --help
# Prints help on how to use the YUI Compressor
#
# --line-break
# Some source control tools don't like files containing lines longer than,
# say 8000 characters. The linebreak option is used in that case to split
# long lines after a specific column. It can also be used to make the code
# more readable, easier to debug (especially with the MS Script Debugger)
# Specify 0 to get a line break after each semi-colon in JavaScript, and
# after each rule in CSS.
#
# --type js|css
# The type of compressor (JavaScript or CSS) is chosen based on the
# extension of the input file name (.js or .css) This option is required
# if no input file has been specified. Otherwise, this option is only
# required if the input file extension is neither 'js' nor 'css'.
#
# --charset character-set
# If a supported character set is specified, the YUI Compressor will use it
# to read the input file. Otherwise, it will assume that the platform's
# default character set is being used. The output file is encoded using
# the same character set.
#
# -o outfile
#
# Place output in file outfile. If not specified, the YUI Compressor will
# default to the standard output, which you can redirect to a file.
# Supports a filter syntax for expressing the output pattern when there are
# multiple input files. ex:
# java -jar yuicompressor.jar -o '.css$:-min.css' *.css
# ... will minify all .css files and save them as -min.css
#
# -v, --verbose
# Display informational messages and warnings.
#
# JAVASCRIPT ONLY OPTIONS
#
# --nomunge
# Minify only. Do not obfuscate local symbols.
#
# --preserve-semi
# Preserve unnecessary semicolons (such as right before a '}') This option
# is useful when compressed code has to be run through JSLint (which is the
# case of YUI for example)
#
# --disable-optimizations
# Disable all the built-in micro optimizations.
#
# -------------- start package javascript --------------
## cat a > b - 将a文件内容合并到b文件中
## cat a >> b - 将a文件内容追加到b文件中
cat
../../blog-web/src/main/resources/static/js/zhyd.core.js
>
zhyd.all.js
cat
../../blog-web/src/main/resources/static/js/zhyd.js
>>
zhyd.all.js
cat
../../blog-web/src/main/resources/static/js/zhyd.comment.js
>>
zhyd.all.js
java
-jar
yuicompressor-2.4.8.jar zhyd.all.js
-o
../../blog-web/src/main/resources/static/js/zhyd.min.js
--charset
utf-8
--type
js
rm
-f
zhyd.all.js
# -------------- start package css --------------
cat
../../blog-web/src/main/resources/static/css/zhyd.core.css
>
zhyd.all.css
cat
../../blog-web/src/main/resources/static/css/zhyd.comment.css
>>
zhyd.all.css
java
-jar
yuicompressor-2.4.8.jar zhyd.all.css
-o
../../blog-web/src/main/resources/static/css/zhyd.min.css
--charset
utf-8
--type
css
rm
-f
zhyd.all.css
\ No newline at end of file
docs/yuicompressor/yuicompressor-2.4.8.jar
0 → 100644
浏览文件 @
cba4c509
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录