Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minify & combine css

  • Loading branch information...
commit ddd2b1339e908ea4a42139dc3814529f7701616e 1 parent dbecaed
@samsonjs authored
View
2  Makefile
@@ -44,4 +44,4 @@ clean:
rm -rf blog/*
rm assets/*.min.js
-.PHONY: proj
+.PHONY: proj blog
View
7 combine.sh
@@ -3,5 +3,8 @@
echo "request,showdown,strftime,tmpl,jquery-serializeObject,blog -> assets/blog-all.min.js"
cat assets/{request,showdown,strftime,tmpl,jquery-serializeObject,blog}.min.js >|assets/blog-all.min.js
-echo "gitter.storage-polyfill,store,proj -> assets/proj-all.min.js"
-cat assets/{gitter,storage-polyfill,store,proj}.min.js >|assets/proj-all.min.js
+echo "gitter.store,proj -> assets/proj-all.min.js"
+cat assets/{gitter,store,proj}.min.js >|assets/proj-all.min.js
+
+echo "style,proj -> assets/proj-all.min.css"
+cat assets/{style,proj}.min.css >|assets/proj-all.min.css
View
6 index.html
@@ -3,12 +3,12 @@
<meta charset=utf-8>
<meta name=viewport content=width=device-width>
<title>samhuri.net</title>
- <link rel=stylesheet href=assets/style.css>
+ <link rel=stylesheet href=assets/style.min.css>
<!--[if lt IE 7]>
- <link rel=stylesheet href=assets/ie6.css>
+ <link rel=stylesheet href=assets/ie6.min.css>
<![endif]-->
<!--[if lt IE 8]>
- <link rel=stylesheet href=assets/ie7.css>
+ <link rel=stylesheet href=assets/ie7.min.css>
<![endif]-->
<script>
var _gaq = _gaq || [];
View
8 minify.sh
@@ -9,3 +9,11 @@ for js (assets/*.js~*.min.js) {
closure-compiler < $js >| $target
fi
}
+
+for css (assets/*.css~*.min.css) {
+ target=${css%.css}.min.css
+ if [ ! -f $target ] || [ $css -nt $target ]; then
+ echo "$css -> $target"
+ yui-compressor $css $target
+ fi
+}
View
2  templates/blog/index.html
@@ -2,7 +2,7 @@
<meta charset=utf-8>
<meta name=viewport content=width=device-width>
<title>sjs' blog</title>
-<link rel=stylesheet href=../assets/blog.css>
+<link rel=stylesheet href=../assets/blog.min.css>
<link rel=alternate type=application/rss+xml href=http://samhuri.net/blog/sjs.rss title="sjs' blog">
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js></script>
<script>
View
2  templates/blog/post.html
@@ -2,7 +2,7 @@
<meta charset=utf-8>
<meta name=viewport content=width=device-width>
<title>{{title}} :: samhuri.net</title>
-<link rel=stylesheet href=../assets/blog.css>
+<link rel=stylesheet href=../assets/blog.min.css>
<link rel=alternate type=application/rss+xml href=http://samhuri.net/blog/sjs.rss title="sjs' blog">
<script>
var _gaq = _gaq || [];
View
12 templates/proj/index.html
@@ -3,14 +3,14 @@
<meta charset=utf-8>
<meta name=viewport content=width=device-width>
<title>projects :: samhuri.net</title>
- <link rel=stylesheet href=../assets/style.css>
+ <link rel=stylesheet href=../assets/style.min.css>
<!--[if IE 6]>
- <link rel=stylesheet href=../assets/ie6.css>
+ <link rel=stylesheet href=../assets/ie6.min.css>
<![endif]-->
<!--[if lt IE 8]>
- <link rel=stylesheet href=../assets/ie7.css>
+ <link rel=stylesheet href=../assets/ie7.min.css>
<script src=http://d1eqzjbvoh1rux.cloudfront.net/json2.min.js></script>
- <script src=../assets/storage-polyfill.js></script>
+ <script src=../assets/storage-polyfill.min.js></script>
<![endif]-->
<style>
#gh { text-align: center }
@@ -29,8 +29,8 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
- <script src=../assets/gitter.js></script>
- <script src=../assets/store.js></script>
+ <script src=../assets/gitter.min.js></script>
+ <script src=../assets/store.min.js></script>
<script>
if (typeof console === 'undefined') {
console = {log:function(){}}
View
9 templates/proj/proj/index.html
@@ -3,8 +3,7 @@
<meta charset=utf-8>
<meta name=viewport content=width=device-width>
<title>{{name}} :: samhuri.net</title>
- <link rel=stylesheet href=../../assets/style.css>
- <link rel=stylesheet href=../../assets/proj.css>
+ <link rel=stylesheet href=../../assets/proj-all.min.css>
<script>
var _gaq = _gaq || [];
_gaq.push( ['_setAccount', 'UA-214054-5']
@@ -19,11 +18,9 @@
</script>
<!--[if lt IE 8]>
<script src=http://d1eqzjbvoh1rux.cloudfront.net/json2.min.js></script>
- <script src=../../assets/storage-polyfill.js></script>
+ <script src=../../assets/storage-polyfill.min.js></script>
<![endif]-->
- <script src=../../assets/gitter.js></script>
- <script src=../../assets/store.js></script>
- <script src=../../assets/proj.js></script>
+ <script src=../../assets/proj-all.min.js></script>
<script> SJS.proj('{{name}}') </script>
</head>
<nav id=breadcrumbs><a href=../../>samhuri.net</a> &rarr; <a href=../>projects</a></nav>
Please sign in to comment.
Something went wrong with that request. Please try again.